Merge pull request #360 from negativeExponent/spu_irq
[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     /* GPU UNAI Advanced Options */
812 #ifdef GPU_UNAI
813    {
814       "pcsx_rearmed_show_gpu_unai_settings",
815       "Advance GPU UNAI/PCSX4All Settings",
816       "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.",
817       {
818          { "disabled", NULL },
819          { "enabled",  NULL },
820          { NULL, NULL},
821       },
822       "disabled",
823    },
824    {
825       "pcsx_rearmed_gpu_unai_blending",
826       "(GPU) Enable Blending",
827       NULL,
828       {
829          { "disabled", NULL },
830          { "enabled",  NULL },
831          { NULL, NULL},
832       },
833       "enabled",
834    },
835    {
836       "pcsx_rearmed_gpu_unai_lighting",
837       "(GPU) Enable Lighting",
838       NULL,
839       {
840          { "disabled", NULL },
841          { "enabled",  NULL },
842          { NULL, NULL},
843       },
844       "enabled",
845    },
846    {
847       "pcsx_rearmed_gpu_unai_fast_lighting",
848       "(GPU) Enable Fast Lighting",
849       NULL,
850       {
851          { "disabled", NULL },
852          { "enabled",  NULL },
853          { NULL, NULL},
854       },
855       "enabled",
856    },
857    {
858       "pcsx_rearmed_gpu_unai_ilace_force",
859       "(GPU) Enable Forced Interlace",
860       NULL,
861       {
862          { "disabled", NULL },
863          { "enabled",  NULL },
864          { NULL, NULL},
865       },
866       "disabled",
867    },
868    {
869       "pcsx_rearmed_gpu_unai_pixel_skip",
870       "(GPU) Enable Pixel Skip",
871       NULL,
872       {
873          { "disabled", NULL },
874          { "enabled",  NULL },
875          { NULL, NULL},
876       },
877       "disabled",
878    },
879 #endif /* GPU UNAI Advanced Settings */
880
881    {
882       "pcsx_rearmed_show_bios_bootlogo",
883       "Show Bios Bootlogo",
884       "When enabled, shows the PlayStation logo when starting or resetting. (Breaks some games).",
885       {
886          { "disabled", NULL },
887          { "enabled",  NULL },
888          { NULL, NULL },
889       },
890       "disabled",
891    },
892    {
893       "pcsx_rearmed_spu_reverb",
894       "Sound Reverb",
895       "Enables or disables audio reverb effect.",
896       {
897          { "disabled", NULL },
898          { "enabled",  NULL },
899          { NULL, NULL },
900       },
901       "enabled",
902    },
903    {
904       "pcsx_rearmed_spu_interpolation",
905       "Sound Interpolation",
906       NULL,
907       {
908          { "simple",   "Simple" },
909          { "gaussian", "Gaussian" },
910          { "cubic",    "Cubic" },
911          { "off",      "disabled" },
912          { NULL, NULL },
913       },
914       "simple",
915    },
916    {
917       "pcsx_rearmed_idiablofix",
918       "Diablo Music Fix",
919       NULL,
920       {
921          { "disabled", NULL },
922          { "enabled",  NULL },
923          { NULL, NULL },
924       },
925       "disabled",
926    },
927    {
928       "pcsx_rearmed_pe2_fix",
929       "Parasite Eve 2/Vandal Hearts 1/2 Fix",
930       NULL,
931       {
932          { "disabled", NULL },
933          { "enabled",  NULL },
934          { NULL, NULL },
935       },
936       "disabled",
937    },
938    {
939       "pcsx_rearmed_inuyasha_fix",
940       "InuYasha Sengoku Battle Fix",
941       NULL,
942       {
943          { "disabled", NULL },
944          { "enabled",  NULL },
945          { NULL, NULL },
946       },
947       "disabled",
948    },
949
950    /* ADVANCED OPTIONS */
951    {
952       "pcsx_rearmed_noxadecoding",
953       "XA Decoding",
954       NULL,
955       {
956          { "disabled", NULL },
957          { "enabled",  NULL },
958          { NULL, NULL },
959       },
960       "enabled",
961    },
962    {
963       "pcsx_rearmed_nocdaudio",
964       "CD Audio",
965       NULL,
966       {
967          { "disabled", NULL },
968          { "enabled",  NULL },
969          { NULL, NULL },
970       },
971       "enabled",
972    },
973    {
974       "pcsx_rearmed_spuirq",
975       "SPU IRQ Always Enabled",
976       "Compatibility tweak, should be left to off in most cases.",
977       {
978          { "disabled", NULL },
979          { "enabled",  NULL },
980          { NULL, NULL },
981       },
982       "disabled",
983    },
984
985 #ifndef DRC_DISABLE
986    {
987       "pcsx_rearmed_nosmccheck",
988       "(Speed Hack) Disable SMC Checks",
989       "Will cause crashes when loading, break memcards.",
990       {
991          { "disabled", NULL },
992          { "enabled",  NULL },
993          { NULL, NULL },
994       },
995       "disabled",
996    },
997    {
998       "pcsx_rearmed_gteregsunneeded",
999       "(Speed Hack) Assume GTE Regs Unneeded",
1000       "May cause graphical glitches.",
1001       {
1002          { "disabled", NULL },
1003          { "enabled",  NULL },
1004          { NULL, NULL },
1005       },
1006       "disabled",
1007    },
1008    {
1009       "pcsx_rearmed_nogteflags",
1010       "(Speed Hack) Disable GTE Flags",
1011       "Will cause graphical glitches.",
1012       {
1013          { "disabled", NULL },
1014          { "enabled",  NULL },
1015          { NULL, NULL },
1016       },
1017       "disabled",
1018    },
1019 #endif /* DRC_DISABLE */
1020
1021    { NULL, NULL, NULL, {{0}}, NULL },
1022 };
1023
1024 /*
1025  ********************************
1026  * Language Mapping
1027  ********************************
1028 */
1029
1030 #ifndef HAVE_NO_LANGEXTRA
1031 struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
1032    option_defs_us, /* RETRO_LANGUAGE_ENGLISH */
1033    NULL,           /* RETRO_LANGUAGE_JAPANESE */
1034    NULL,           /* RETRO_LANGUAGE_FRENCH */
1035    NULL,           /* RETRO_LANGUAGE_SPANISH */
1036    NULL,           /* RETRO_LANGUAGE_GERMAN */
1037    NULL,           /* RETRO_LANGUAGE_ITALIAN */
1038    NULL,           /* RETRO_LANGUAGE_DUTCH */
1039    NULL,           /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
1040    NULL,           /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
1041    NULL,           /* RETRO_LANGUAGE_RUSSIAN */
1042    NULL,           /* RETRO_LANGUAGE_KOREAN */
1043    NULL,           /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
1044    NULL,           /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
1045    NULL,           /* RETRO_LANGUAGE_ESPERANTO */
1046    NULL,           /* RETRO_LANGUAGE_POLISH */
1047    NULL,           /* RETRO_LANGUAGE_VIETNAMESE */
1048    NULL,           /* RETRO_LANGUAGE_ARABIC */
1049    NULL,           /* RETRO_LANGUAGE_GREEK */
1050    option_defs_tr, /* RETRO_LANGUAGE_TURKISH */
1051 };
1052 #endif
1053
1054 /*
1055  ********************************
1056  * Functions
1057  ********************************
1058 */
1059
1060 /* Handles configuration/setting of core options.
1061  * Should be called as early as possible - ideally inside
1062  * retro_set_environment(), and no later than retro_load_game()
1063  * > We place the function body in the header to avoid the
1064  *   necessity of adding more .c files (i.e. want this to
1065  *   be as painless as possible for core devs)
1066  */
1067
1068 static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
1069 {
1070    unsigned version = 0;
1071
1072    if (!environ_cb)
1073       return;
1074
1075    if (environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version) && (version >= 1))
1076    {
1077 #ifndef HAVE_NO_LANGEXTRA
1078       struct retro_core_options_intl core_options_intl;
1079       unsigned language = 0;
1080
1081       core_options_intl.us    = option_defs_us;
1082       core_options_intl.local = NULL;
1083
1084       if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1085           (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
1086          core_options_intl.local = option_defs_intl[language];
1087
1088       environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_intl);
1089 #else
1090       environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, &option_defs_us);
1091 #endif
1092    }
1093    else
1094    {
1095       size_t i;
1096       size_t option_index              = 0;
1097       size_t num_options               = 0;
1098       struct retro_variable *variables = NULL;
1099       char **values_buf                = NULL;
1100
1101       /* Determine number of options
1102        * > Note: We are going to skip a number of irrelevant
1103        *   core options when building the retro_variable array,
1104        *   but we'll allocate space for all of them. The difference
1105        *   in resource usage is negligible, and this allows us to
1106        *   keep the code 'cleaner' */
1107       while (true)
1108       {
1109          if (option_defs_us[num_options].key)
1110             num_options++;
1111          else
1112             break;
1113       }
1114
1115       /* Allocate arrays */
1116       variables  = (struct retro_variable *)calloc(num_options + 1, sizeof(struct retro_variable));
1117       values_buf = (char **)calloc(num_options, sizeof(char *));
1118
1119       if (!variables || !values_buf)
1120          goto error;
1121
1122       /* Copy parameters from option_defs_us array */
1123       for (i = 0; i < num_options; i++)
1124       {
1125          const char *key                        = option_defs_us[i].key;
1126          const char *desc                       = option_defs_us[i].desc;
1127          const char *default_value              = option_defs_us[i].default_value;
1128          struct retro_core_option_value *values = option_defs_us[i].values;
1129          size_t buf_len                         = 3;
1130          size_t default_index                   = 0;
1131
1132          values_buf[i] = NULL;
1133
1134          /* Skip options that are irrelevant when using the
1135           * old style core options interface */
1136          if ((strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0))
1137             continue;
1138
1139          if (desc)
1140          {
1141             size_t num_values = 0;
1142
1143             /* Determine number of values */
1144             while (true)
1145             {
1146                if (values[num_values].value)
1147                {
1148                   /* Check if this is the default value */
1149                   if (default_value)
1150                      if (strcmp(values[num_values].value, default_value) == 0)
1151                         default_index = num_values;
1152
1153                   buf_len += strlen(values[num_values].value);
1154                   num_values++;
1155                }
1156                else
1157                   break;
1158             }
1159
1160             /* Build values string */
1161             if (num_values > 0)
1162             {
1163                size_t j;
1164
1165                buf_len += num_values - 1;
1166                buf_len += strlen(desc);
1167
1168                values_buf[i] = (char *)calloc(buf_len, sizeof(char));
1169                if (!values_buf[i])
1170                   goto error;
1171
1172                strcpy(values_buf[i], desc);
1173                strcat(values_buf[i], "; ");
1174
1175                /* Default value goes first */
1176                strcat(values_buf[i], values[default_index].value);
1177
1178                /* Add remaining values */
1179                for (j = 0; j < num_values; j++)
1180                {
1181                   if (j != default_index)
1182                   {
1183                      strcat(values_buf[i], "|");
1184                      strcat(values_buf[i], values[j].value);
1185                   }
1186                }
1187             }
1188          }
1189
1190          variables[option_index].key   = key;
1191          variables[option_index].value = values_buf[i];
1192          option_index++;
1193       }
1194
1195       /* Set variables */
1196       environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
1197
1198 error:
1199
1200       /* Clean up */
1201       if (values_buf)
1202       {
1203          for (i = 0; i < num_options; i++)
1204          {
1205             if (values_buf[i])
1206             {
1207                free(values_buf[i]);
1208                values_buf[i] = NULL;
1209             }
1210          }
1211
1212          free(values_buf);
1213          values_buf = NULL;
1214       }
1215
1216       if (variables)
1217       {
1218          free(variables);
1219          variables = NULL;
1220       }
1221    }
1222 }
1223
1224 #ifdef __cplusplus
1225 }
1226 #endif
1227
1228 #endif