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