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