Adding Guncon support for mouse based lightguns
[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       "enabled",
534    },
535
536 #ifndef DRC_DISABLE
537    {
538       "pcsx_rearmed_drc",
539       "Dynamic Recompiler",
540       "Enables core to use dynamic recompiler or interpreter (slower) CPU instructions.",
541       {
542          { "disabled", NULL },
543          { "enabled",  NULL },
544          { NULL, NULL },
545       },
546       "enabled",
547    },
548    {
549       "pcsx_rearmed_psxclock",
550       "PSX CPU Clock",
551 #ifdef HAVE_PRE_ARMV7
552       "Overclock or underclock the PSX clock. Default is 50",
553 #else
554       "Overclock or underclock the PSX clock. Default is 57",
555 #endif
556       {
557          { "30",  NULL },
558          { "31",  NULL },
559          { "32",  NULL },
560          { "33",  NULL },
561          { "34",  NULL },
562          { "35",  NULL },
563          { "36",  NULL },
564          { "37",  NULL },
565          { "38",  NULL },
566          { "39",  NULL },
567          { "40",  NULL },
568          { "41",  NULL },
569          { "42",  NULL },
570          { "43",  NULL },
571          { "44",  NULL },
572          { "45",  NULL },
573          { "46",  NULL },
574          { "47",  NULL },
575          { "48",  NULL },
576          { "49",  NULL },
577          { "50",  NULL },
578          { "51",  NULL },
579          { "52",  NULL },
580          { "53",  NULL },
581          { "54",  NULL },
582          { "55",  NULL },
583          { "56",  NULL },
584          { "57",  NULL },
585          { "58",  NULL },
586          { "59",  NULL },
587          { "60",  NULL },
588          { "61",  NULL },
589          { "62",  NULL },
590          { "63",  NULL },
591          { "64",  NULL },
592          { "65",  NULL },
593          { "66",  NULL },
594          { "67",  NULL },
595          { "68",  NULL },
596          { "69",  NULL },
597          { "70",  NULL },
598          { "71",  NULL },
599          { "72",  NULL },
600          { "73",  NULL },
601          { "74",  NULL },
602          { "75",  NULL },
603          { "76",  NULL },
604          { "77",  NULL },
605          { "78",  NULL },
606          { "79",  NULL },
607          { "80",  NULL },
608          { "81",  NULL },
609          { "82",  NULL },
610          { "83",  NULL },
611          { "84",  NULL },
612          { "85",  NULL },
613          { "86",  NULL },
614          { "87",  NULL },
615          { "88",  NULL },
616          { "89",  NULL },
617          { "90",  NULL },
618          { "91",  NULL },
619          { "92",  NULL },
620          { "93",  NULL },
621          { "94",  NULL },
622          { "95",  NULL },
623          { "96",  NULL },
624          { "97",  NULL },
625          { "98",  NULL },
626          { "99",  NULL },
627          { "100", NULL },
628          { NULL, NULL },
629       },
630 #ifdef HAVE_PRE_ARMV7
631       "50",
632 #else
633       "57",
634 #endif
635    },
636 #endif /* DRC_DISABLE */
637
638 #ifdef __ARM_NEON__
639    {
640       "pcsx_rearmed_neon_interlace_enable",
641       "Enable Interlacing Mode",
642       "Enables fake scanlines effect.",
643       {
644          { "disabled", NULL },
645          { "enabled",  NULL },
646          { NULL, NULL },
647       },
648       "disabled",
649    },
650    {
651       "pcsx_rearmed_neon_enhancement_enable",
652       "Enhanced Resolution (Slow)",
653       "Renders in double resolution at the cost of lower performance.",
654       {
655          { "disabled", NULL },
656          { "enabled",  NULL },
657          { NULL, NULL },
658       },
659       "disabled",
660    },
661    {
662       "pcsx_rearmed_neon_enhancement_no_main",
663       "Enhanced Resolution (Speed Hack)",
664       "Speed hack for Enhanced resolution option (glitches some games).",
665       {
666          { "disabled", NULL },
667          { "enabled",  NULL },
668          { NULL, NULL },
669       },
670       "disabled",
671    },
672 #endif /* __ARM_NEON__ */
673
674    {
675       "pcsx_rearmed_duping_enable",
676       "Frame Duping",
677       "A speedup, redraws/reuses the last frame if there was no new data.",
678       {
679          { "disabled", NULL },
680          { "enabled",  NULL },
681          { NULL, NULL },
682       },
683       "enabled",
684    },
685    {
686       "pcsx_rearmed_display_internal_fps",
687       "Display Internal FPS",
688       "Shows an on-screen frames per second counter when enabled.",
689       {
690          { "disabled", NULL },
691          { "enabled",  NULL },
692          { NULL, NULL },
693       },
694       "disabled",
695    },
696
697    /* GPU PEOPS OPTIONS */
698 #ifdef GPU_PEOPS
699    {
700       "pcsx_rearmed_show_gpu_peops_settings",
701       "Advanced GPU P.E.Op.S. Settings",
702       "Shows or hides advanced GPU plugin settings. NOTE: Quick Menu must be toggled for this setting to take effect.",
703       {
704          { "disabled", NULL },
705          { "enabled",  NULL },
706          { NULL, NULL },
707       },
708       "disabled",
709    },
710    {
711       "pcsx_rearmed_gpu_peops_odd_even_bit",
712       "(GPU) Odd/Even Bit Hack",
713       "Needed for Chrono Cross.",
714       {
715          { "disabled", NULL },
716          { "enabled",  NULL },
717          { NULL, NULL },
718       },
719       "disabled",
720    },
721    {
722       "pcsx_rearmed_gpu_peops_expand_screen_width",
723       "(GPU) Expand Screen Width",
724       "Capcom fighting games",
725       {
726          { "disabled", NULL },
727          { "enabled",  NULL },
728          { NULL, NULL },
729       },
730       "disabled",
731    },
732    {
733       "pcsx_rearmed_gpu_peops_ignore_brightness",
734       "(GPU) Ignore Brightness Color",
735       "Black screens in Lunar Silver Star Story games",
736       {
737          { "disabled", NULL },
738          { "enabled",  NULL },
739          { NULL, NULL },
740       },
741       "disabled",
742    },
743    {
744       "pcsx_rearmed_gpu_peops_disable_coord_check",
745       "(GPU) Disable Coordinate Check",
746       "Compatibility mode",
747       {
748          { "disabled", NULL },
749          { "enabled",  NULL },
750          { NULL, NULL },
751       },
752       "disabled",
753    },
754    {
755       "pcsx_rearmed_gpu_peops_lazy_screen_update",
756       "(GPU) Lazy Screen Update",
757       "Pandemonium 2",
758       {
759          { "disabled", NULL },
760          { "enabled",  NULL },
761          { NULL, NULL },
762       },
763       "disabled",
764    },
765    {
766       "pcsx_rearmed_gpu_peops_old_frame_skip",
767       "(GPU) Old Frame Skipping",
768       "Skip every second frame",
769       {
770          { "disabled", NULL },
771          { "enabled",  NULL },
772          { NULL, NULL },
773       },
774       "enabled",
775    },
776    {
777       "pcsx_rearmed_gpu_peops_repeated_triangles",
778       "(GPU) Repeated Flat Tex Triangles",
779       "Needed by Star Wars: Dark Forces",
780       {
781          { "disabled", NULL },
782          { "enabled",  NULL },
783          { NULL, NULL },
784       },
785       "disabled",
786    },
787    {
788       "pcsx_rearmed_gpu_peops_quads_with_triangles",
789       "(GPU) Draw Quads with Triangles",
790       "Better g-colors, worse textures",
791       {
792          { "disabled", NULL },
793          { "enabled",  NULL },
794          { NULL, NULL },
795       },
796       "disabled",
797    },
798    {
799       "pcsx_rearmed_gpu_peops_fake_busy_state",
800       "(GPU) Fake 'Gpu Busy' States",
801       "Toggle busy flags after drawing",
802       {
803          { "disabled", NULL },
804          { "enabled",  NULL },
805          { NULL, NULL },
806       },
807       "disabled",
808    },
809 #endif
810
811    {
812       "pcsx_rearmed_show_bios_bootlogo",
813       "Show Bios Bootlogo",
814       "When enabled, shows the PlayStation logo when starting or resetting. (Breaks some games).",
815       {
816          { "disabled", NULL },
817          { "enabled",  NULL },
818          { NULL, NULL },
819       },
820       "disabled",
821    },
822    {
823       "pcsx_rearmed_spu_reverb",
824       "Sound Reverb",
825       "Enables or disables audio reverb effect.",
826       {
827          { "disabled", NULL },
828          { "enabled",  NULL },
829          { NULL, NULL },
830       },
831       "enabled",
832    },
833    {
834       "pcsx_rearmed_spu_interpolation",
835       "Sound Interpolation",
836       NULL,
837       {
838          { "simple",   "Simple" },
839          { "gaussian", "Gaussian" },
840          { "cubic",    "Cubic" },
841          { "off",      "disabled" },
842          { NULL, NULL },
843       },
844       "simple",
845    },
846    {
847       "pcsx_rearmed_idiablofix",
848       "Diablo Music Fix",
849       NULL,
850       {
851          { "disabled", NULL },
852          { "enabled",  NULL },
853          { NULL, NULL },
854       },
855       "disabled",
856    },
857    {
858       "pcsx_rearmed_pe2_fix",
859       "Parasite Eve 2/Vandal Hearts 1/2 Fix",
860       NULL,
861       {
862          { "disabled", NULL },
863          { "enabled",  NULL },
864          { NULL, NULL },
865       },
866       "disabled",
867    },
868    {
869       "pcsx_rearmed_inuyasha_fix",
870       "InuYasha Sengoku Battle Fix",
871       NULL,
872       {
873          { "disabled", NULL },
874          { "enabled",  NULL },
875          { NULL, NULL },
876       },
877       "disabled",
878    },
879
880    /* ADVANCED OPTIONS */
881    {
882       "pcsx_rearmed_noxadecoding",
883       "XA Decoding",
884       NULL,
885       {
886          { "disabled", NULL },
887          { "enabled",  NULL },
888          { NULL, NULL },
889       },
890       "enabled",
891    },
892    {
893       "pcsx_rearmed_nocdaudio",
894       "CD Audio",
895       NULL,
896       {
897          { "disabled", NULL },
898          { "enabled",  NULL },
899          { NULL, NULL },
900       },
901       "enabled",
902    },
903
904 #ifndef DRC_DISABLE
905    {
906       "pcsx_rearmed_nosmccheck",
907       "(Speed Hack) Disable SMC Checks",
908       "Will cause crashes when loading, break memcards.",
909       {
910          { "disabled", NULL },
911          { "enabled",  NULL },
912          { NULL, NULL },
913       },
914       "disabled",
915    },
916    {
917       "pcsx_rearmed_gteregsunneeded",
918       "(Speed Hack) Assume GTE Regs Unneeded",
919       "May cause graphical glitches.",
920       {
921          { "disabled", NULL },
922          { "enabled",  NULL },
923          { NULL, NULL },
924       },
925       "disabled",
926    },
927    {
928       "pcsx_rearmed_nogteflags",
929       "(Speed Hack) Disable GTE Flags",
930       "Will cause graphical glitches.",
931       {
932          { "disabled", NULL },
933          { "enabled",  NULL },
934          { NULL, NULL },
935       },
936       "disabled",
937    },
938 #endif /* DRC_DISABLE */
939
940    { NULL, NULL, NULL, {{0}}, NULL },
941 };
942
943 /*
944  ********************************
945  * Language Mapping
946  ********************************
947 */
948
949 #ifndef HAVE_NO_LANGEXTRA
950 struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
951    option_defs_us, /* RETRO_LANGUAGE_ENGLISH */
952    NULL,           /* RETRO_LANGUAGE_JAPANESE */
953    NULL,           /* RETRO_LANGUAGE_FRENCH */
954    NULL,           /* RETRO_LANGUAGE_SPANISH */
955    NULL,           /* RETRO_LANGUAGE_GERMAN */
956    NULL,           /* RETRO_LANGUAGE_ITALIAN */
957    NULL,           /* RETRO_LANGUAGE_DUTCH */
958    NULL,           /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
959    NULL,           /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
960    NULL,           /* RETRO_LANGUAGE_RUSSIAN */
961    NULL,           /* RETRO_LANGUAGE_KOREAN */
962    NULL,           /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
963    NULL,           /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
964    NULL,           /* RETRO_LANGUAGE_ESPERANTO */
965    NULL,           /* RETRO_LANGUAGE_POLISH */
966    NULL,           /* RETRO_LANGUAGE_VIETNAMESE */
967    NULL,           /* RETRO_LANGUAGE_ARABIC */
968    NULL,           /* RETRO_LANGUAGE_GREEK */
969    option_defs_tr, /* RETRO_LANGUAGE_TURKISH */
970 };
971 #endif
972
973 /*
974  ********************************
975  * Functions
976  ********************************
977 */
978
979 /* Handles configuration/setting of core options.
980  * Should be called as early as possible - ideally inside
981  * retro_set_environment(), and no later than retro_load_game()
982  * > We place the function body in the header to avoid the
983  *   necessity of adding more .c files (i.e. want this to
984  *   be as painless as possible for core devs)
985  */
986
987 static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
988 {
989    unsigned version = 0;
990
991    if (!environ_cb)
992       return;
993
994    if (environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version) && (version >= 1))
995    {
996 #ifndef HAVE_NO_LANGEXTRA
997       struct retro_core_options_intl core_options_intl;
998       unsigned language = 0;
999
1000       core_options_intl.us    = option_defs_us;
1001       core_options_intl.local = NULL;
1002
1003       if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1004           (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
1005          core_options_intl.local = option_defs_intl[language];
1006
1007       environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_intl);
1008 #else
1009       environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, &option_defs_us);
1010 #endif
1011    }
1012    else
1013    {
1014       size_t i;
1015       size_t option_index              = 0;
1016       size_t num_options               = 0;
1017       struct retro_variable *variables = NULL;
1018       char **values_buf                = NULL;
1019
1020       /* Determine number of options
1021        * > Note: We are going to skip a number of irrelevant
1022        *   core options when building the retro_variable array,
1023        *   but we'll allocate space for all of them. The difference
1024        *   in resource usage is negligible, and this allows us to
1025        *   keep the code 'cleaner' */
1026       while (true)
1027       {
1028          if (option_defs_us[num_options].key)
1029             num_options++;
1030          else
1031             break;
1032       }
1033
1034       /* Allocate arrays */
1035       variables  = (struct retro_variable *)calloc(num_options + 1, sizeof(struct retro_variable));
1036       values_buf = (char **)calloc(num_options, sizeof(char *));
1037
1038       if (!variables || !values_buf)
1039          goto error;
1040
1041       /* Copy parameters from option_defs_us array */
1042       for (i = 0; i < num_options; i++)
1043       {
1044          const char *key                        = option_defs_us[i].key;
1045          const char *desc                       = option_defs_us[i].desc;
1046          const char *default_value              = option_defs_us[i].default_value;
1047          struct retro_core_option_value *values = option_defs_us[i].values;
1048          size_t buf_len                         = 3;
1049          size_t default_index                   = 0;
1050
1051          values_buf[i] = NULL;
1052
1053          /* Skip options that are irrelevant when using the
1054           * old style core options interface */
1055          if ((strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0))
1056             continue;
1057
1058          if (desc)
1059          {
1060             size_t num_values = 0;
1061
1062             /* Determine number of values */
1063             while (true)
1064             {
1065                if (values[num_values].value)
1066                {
1067                   /* Check if this is the default value */
1068                   if (default_value)
1069                      if (strcmp(values[num_values].value, default_value) == 0)
1070                         default_index = num_values;
1071
1072                   buf_len += strlen(values[num_values].value);
1073                   num_values++;
1074                }
1075                else
1076                   break;
1077             }
1078
1079             /* Build values string */
1080             if (num_values > 0)
1081             {
1082                size_t j;
1083
1084                buf_len += num_values - 1;
1085                buf_len += strlen(desc);
1086
1087                values_buf[i] = (char *)calloc(buf_len, sizeof(char));
1088                if (!values_buf[i])
1089                   goto error;
1090
1091                strcpy(values_buf[i], desc);
1092                strcat(values_buf[i], "; ");
1093
1094                /* Default value goes first */
1095                strcat(values_buf[i], values[default_index].value);
1096
1097                /* Add remaining values */
1098                for (j = 0; j < num_values; j++)
1099                {
1100                   if (j != default_index)
1101                   {
1102                      strcat(values_buf[i], "|");
1103                      strcat(values_buf[i], values[j].value);
1104                   }
1105                }
1106             }
1107          }
1108
1109          variables[option_index].key   = key;
1110          variables[option_index].value = values_buf[i];
1111          option_index++;
1112       }
1113
1114       /* Set variables */
1115       environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
1116
1117 error:
1118
1119       /* Clean up */
1120       if (values_buf)
1121       {
1122          for (i = 0; i < num_options; i++)
1123          {
1124             if (values_buf[i])
1125             {
1126                free(values_buf[i]);
1127                values_buf[i] = NULL;
1128             }
1129          }
1130
1131          free(values_buf);
1132          values_buf = NULL;
1133       }
1134
1135       if (variables)
1136       {
1137          free(variables);
1138          variables = NULL;
1139       }
1140    }
1141 }
1142
1143 #ifdef __cplusplus
1144 }
1145 #endif
1146
1147 #endif