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