psxinterpreter: use cycle_multiplier also
[pcsx_rearmed.git] / frontend / libretro_core_options.h
CommitLineData
919cac88 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
fbe06628 10#ifndef HAVE_NO_LANGEXTRA
11#include "libretro_core_options_intl.h"
12#endif
13
14/*
15 ********************************
f3c6ae10 16 * VERSION: 2.0
fbe06628 17 ********************************
18 *
f3c6ae10 19 * - 2.0: Add support for core options v2 interface
fbe06628 20 * - 1.3: Move translations to libretro_core_options_intl.h
21 * - libretro_core_options_intl.h includes BOM and utf-8
22 * fix for MSVC 2010-2013
23 * - Added HAVE_NO_LANGEXTRA flag to disable translations
24 * on platforms/compilers without BOM support
25 * - 1.2: Use core options v1 interface when
26 * RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION is >= 1
27 * (previously required RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION == 1)
28 * - 1.1: Support generation of core options v0 retro_core_option_value
29 * arrays containing options with a single value
30 * - 1.0: First commit
31*/
32
919cac88 33#ifdef __cplusplus
34extern "C" {
35#endif
36
37/*
38 ********************************
39 * Core Option Definitions
40 ********************************
41*/
42
43/* RETRO_LANGUAGE_ENGLISH */
44
45/* Default language:
46 * - All other languages must include the same keys and values
47 * - Will be used as a fallback in the event that frontend language
48 * is not available
49 * - Will be used as a fallback for any missing entries in
50 * frontend language definition
51 */
52
f3c6ae10 53struct retro_core_option_v2_category option_cats_us[] = {
5201e92f 54 {
f3c6ae10 55 "system",
56 "System",
57 "Configure base hardware parameters: region, BIOS selection, memory cards, etc."
5eaa13f1
A
58 },
59 {
f3c6ae10 60 "video",
61 "Video",
62 "Configure base display parameters."
5eaa13f1 63 },
f3c6ae10 64#ifdef GPU_NEON
5eaa13f1 65 {
f3c6ae10 66 "gpu_neon",
67 "GPU Plugin",
68 "Configure low-level settings of the NEON GPU plugin."
919cac88 69 },
f3c6ae10 70#endif
71#ifdef GPU_PEOPS
919cac88 72 {
f3c6ae10 73 "gpu_peops",
74 "GPU Plugin (Advanced)",
75 "Configure low-level settings of the P.E.Op.S. GPU plugin."
919cac88 76 },
f3c6ae10 77#endif
78#ifdef GPU_UNAI
919cac88 79 {
f3c6ae10 80 "gpu_unai",
81 "GPU Plugin (Advanced)",
82 "Configure low-level settings of the UNAI GPU plugin."
919cac88 83 },
f3c6ae10 84#endif
919cac88 85 {
f3c6ae10 86 "audio",
87 "Audio",
88 "Configure sound emulation: reverb, interpolation, CD audio decoding."
ce239f4a 89 },
90 {
f3c6ae10 91 "input",
92 "Input",
93 "Configure input devices: analog response, haptic feedback, Multitaps, light guns, etc."
919cac88 94 },
399a33fe 95 {
f3c6ae10 96 "compat_hack",
97 "Compatibility Fixes",
98 "Configure settings/workarounds required for correct operation of specific games."
919cac88 99 },
f3c6ae10 100#if !defined(DRC_DISABLE) && !defined(LIGHTREC)
919cac88 101 {
f3c6ae10 102 "speed_hack",
103 "Speed Hacks (Advanced)",
104 "Configure hacks that may improve performance at the expense of decreased accuracy/stability."
919cac88 105 },
f3c6ae10 106#endif
107 { NULL, NULL, NULL },
108};
109
110struct retro_core_option_v2_definition option_defs_us[] = {
919cac88 111 {
f3c6ae10 112 "pcsx_rearmed_region",
113 "Region",
114 NULL,
115 "Specify which region the system is from. 'NTSC' is 60 Hz while 'PAL' is 50 Hz. 'Auto' will detect the region of the currently loaded content. Games may run faster or slower than normal if the incorrect region is selected.",
116 NULL,
117 "system",
919cac88 118 {
f3c6ae10 119 { "auto", "Auto" },
120 { "NTSC", NULL },
121 { "PAL", NULL },
fbe06628 122 { NULL, NULL },
919cac88 123 },
f3c6ae10 124 "auto",
919cac88 125 },
ace1989f 126 {
f3c6ae10 127 "pcsx_rearmed_bios",
128 "BIOS Selection",
129 NULL,
130 "Specify which BIOS to use. 'Auto' will attempt to load a real bios file from the frontend 'system' directory, falling back to high level emulation if unavailable. 'HLE' forces high level BIOS emulation. It is recommended to use an official bios file for better compatibility.",
131 NULL,
132 "system",
ace1989f 133 {
f3c6ae10 134 { "auto", "Auto" },
135 { "HLE", NULL },
ace1989f
SK
136 { NULL, NULL },
137 },
f3c6ae10 138 "auto",
ace1989f 139 },
919cac88 140 {
f3c6ae10 141 "pcsx_rearmed_show_bios_bootlogo",
142 "Show BIOS Boot Logo",
143 NULL,
144 "When using an official BIOS file, specify whether to show the PlayStation logo upon starting or resetting content. Warning: Enabling the boot logo may reduce game compatibility.",
145 NULL,
146 "system",
919cac88 147 {
148 { "disabled", NULL },
149 { "enabled", NULL },
fbe06628 150 { NULL, NULL },
919cac88 151 },
f3c6ae10 152 "disabled",
000655e4
S
153 },
154 {
f3c6ae10 155 "pcsx_rearmed_memcard2",
156 "Enable Second Memory Card (Shared)",
157 NULL,
158 "Emulate a second memory card in slot 2. This will be shared by all games.",
159 NULL,
160 "system",
000655e4 161 {
f3c6ae10 162 { "disabled", NULL },
163 { "enabled", NULL },
000655e4
S
164 { NULL, NULL },
165 },
f3c6ae10 166 "disabled",
000655e4 167 },
f3c6ae10 168#ifndef _WIN32
000655e4 169 {
f3c6ae10 170 "pcsx_rearmed_async_cd",
171 "CD Access Method (Restart)",
172 NULL,
173 "Select method used to read data from content disk images. 'Synchronous' mimics original hardware. 'Asynchronous' can reduce stuttering on devices with slow storage. 'Pre-Cache (CHD)' loads disk image into memory for faster access (CHD files only).",
174 NULL,
175 "system",
000655e4 176 {
f3c6ae10 177 { "sync", "Synchronous" },
178 { "async", "Asynchronous" },
179 { "precache", "Pre-Cache (CHD)" },
180 { NULL, NULL},
000655e4 181 },
f3c6ae10 182 "sync",
000655e4 183 },
12367ad0 184#endif
630b122b 185#ifndef DRC_DISABLE
919cac88 186 {
187 "pcsx_rearmed_drc",
c8108d88 188 "Dynamic Recompiler",
f3c6ae10 189 NULL,
190 "Dynamically recompile PSX CPU instructions to native instructions. Much faster than using an interpreter, but may be less accurate on some platforms.",
191 NULL,
192 "system",
919cac88 193 {
194 { "disabled", NULL },
195 { "enabled", NULL },
fbe06628 196 { NULL, NULL },
919cac88 197 },
198 "enabled",
199 },
630b122b 200#endif
630b122b 201#if !defined(DRC_DISABLE) && !defined(LIGHTREC)
919cac88 202 {
203 "pcsx_rearmed_psxclock",
f3c6ae10 204 "PSX CPU Clock Speed",
205 NULL,
44e8d7af 206#if defined(HAVE_PRE_ARMV7) && !defined(_3DS)
f3c6ae10 207 "Overclock or under-clock the PSX CPU. Lower values may reduce performance requirements while higher values may improve frame rates in demanding games at the expense of increased overheads; setting the value too low or high may reduce compatibility. Default is 50.",
fbe06628 208#else
f3c6ae10 209 "Overclock or under-clock the PSX CPU. Lower values may reduce performance requirements while higher values may improve frame rates in demanding games at the expense of increased overheads; setting the value too low or high may reduce compatibility. Default is 57.",
fbe06628 210#endif
f3c6ae10 211 NULL,
212 "system",
919cac88 213 {
fbe06628 214 { "30", NULL },
215 { "31", NULL },
216 { "32", NULL },
217 { "33", NULL },
218 { "34", NULL },
219 { "35", NULL },
220 { "36", NULL },
221 { "37", NULL },
222 { "38", NULL },
223 { "39", NULL },
224 { "40", NULL },
225 { "41", NULL },
226 { "42", NULL },
227 { "43", NULL },
228 { "44", NULL },
229 { "45", NULL },
230 { "46", NULL },
231 { "47", NULL },
232 { "48", NULL },
233 { "49", NULL },
234 { "50", NULL },
235 { "51", NULL },
236 { "52", NULL },
237 { "53", NULL },
238 { "54", NULL },
239 { "55", NULL },
240 { "56", NULL },
241 { "57", NULL },
242 { "58", NULL },
243 { "59", NULL },
244 { "60", NULL },
245 { "61", NULL },
246 { "62", NULL },
247 { "63", NULL },
248 { "64", NULL },
249 { "65", NULL },
250 { "66", NULL },
251 { "67", NULL },
252 { "68", NULL },
253 { "69", NULL },
254 { "70", NULL },
255 { "71", NULL },
256 { "72", NULL },
257 { "73", NULL },
258 { "74", NULL },
259 { "75", NULL },
260 { "76", NULL },
261 { "77", NULL },
262 { "78", NULL },
263 { "79", NULL },
264 { "80", NULL },
265 { "81", NULL },
266 { "82", NULL },
267 { "83", NULL },
268 { "84", NULL },
269 { "85", NULL },
270 { "86", NULL },
271 { "87", NULL },
272 { "88", NULL },
273 { "89", NULL },
274 { "90", NULL },
275 { "91", NULL },
276 { "92", NULL },
277 { "93", NULL },
278 { "94", NULL },
279 { "95", NULL },
280 { "96", NULL },
281 { "97", NULL },
282 { "98", NULL },
283 { "99", NULL },
919cac88 284 { "100", NULL },
fbe06628 285 { NULL, NULL },
919cac88 286 },
44e8d7af 287#if defined(HAVE_PRE_ARMV7) && !defined(_3DS)
fbe06628 288 "50",
289#else
290 "57",
291#endif
919cac88 292 },
630b122b 293#endif /* !DRC_DISABLE && !LIGHTREC */
919cac88 294 {
f3c6ae10 295 "pcsx_rearmed_dithering",
296 "Dithering Pattern",
297 NULL,
298 "Enable emulation of the dithering technique used by the PSX to smooth out color banding artifacts. Increases performance requirements.",
299 NULL,
300 "video",
301 {
302 { "disabled", NULL },
303 { "enabled", NULL },
304 { NULL, NULL },
305 },
306#if defined HAVE_LIBNX || defined _3DS
307 "disabled",
308#else
309 "enabled",
310#endif
311 },
312 {
313 "pcsx_rearmed_duping_enable",
314 "Frame Duping (Speedup)",
315 NULL,
316 "When enabled and supported by the libretro frontend, provides a small performance increase by directing the frontend to repeat the previous frame if the core has nothing new to display.",
317 NULL,
318 "video",
919cac88 319 {
320 { "disabled", NULL },
321 { "enabled", NULL },
fbe06628 322 { NULL, NULL },
919cac88 323 },
f3c6ae10 324 "enabled",
325 },
326#ifdef THREAD_RENDERING
327 {
328 "pcsx_rearmed_gpu_thread_rendering",
329 "Threaded Rendering",
330 NULL,
331 "When enabled, runs GPU commands in a secondary thread. 'Synchronous' improves performance while maintaining proper frame pacing. 'Asynchronous' improves performance even further, but may cause dropped frames and increased latency. Produces best results with games that run natively at less than 60 frames per second.",
332 NULL,
333 "video",
334 {
335 { "disabled", NULL },
336 { "sync", "Synchronous" },
337 { "async", "Asynchronous" },
338 { NULL, NULL},
339 },
340 "disabled",
341 },
342#endif
343 {
344 "pcsx_rearmed_frameskip_type",
345 "Frameskip",
346 NULL,
347 "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.",
348 NULL,
349 "video",
350 {
351 { "disabled", NULL },
352 { "auto", "Auto" },
353 { "auto_threshold", "Auto (Threshold)" },
354 { "fixed_interval", "Fixed Interval" },
355 { NULL, NULL },
356 },
357 "disabled"
358 },
359 {
360 "pcsx_rearmed_frameskip_threshold",
361 "Frameskip Threshold (%)",
362 NULL,
363 "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.",
364 NULL,
365 "video",
366 {
367 { "15", NULL },
368 { "18", NULL },
369 { "21", NULL },
370 { "24", NULL },
371 { "27", NULL },
372 { "30", NULL },
373 { "33", NULL },
374 { "36", NULL },
375 { "39", NULL },
376 { "42", NULL },
377 { "45", NULL },
378 { "48", NULL },
379 { "51", NULL },
380 { "54", NULL },
381 { "57", NULL },
382 { "60", NULL },
383 { NULL, NULL },
384 },
385 "33"
386 },
387 {
388 "pcsx_rearmed_frameskip_interval",
389 "Frameskip Interval",
390 NULL,
391 "Specify the maximum number of frames that can be skipped before a new frame is rendered.",
392 NULL,
393 "video",
394 {
395 { "1", NULL },
396 { "2", NULL },
397 { "3", NULL },
398 { "4", NULL },
399 { "5", NULL },
400 { "6", NULL },
401 { "7", NULL },
402 { "8", NULL },
403 { "9", NULL },
404 { "10", NULL },
405 { NULL, NULL },
406 },
407 "3"
919cac88 408 },
409 {
f3c6ae10 410 "pcsx_rearmed_display_internal_fps",
411 "Display Internal FPS",
412 NULL,
413 "Show the internal frame rate at which the emulated PlayStation system is rendering content. Note: Requires on-screen notifications to be enabled in the libretro frontend.",
414 NULL,
415 "video",
919cac88 416 {
417 { "disabled", NULL },
418 { "enabled", NULL },
fbe06628 419 { NULL, NULL },
919cac88 420 },
421 "disabled",
422 },
f3c6ae10 423#ifdef GPU_NEON
919cac88 424 {
f3c6ae10 425 "pcsx_rearmed_neon_interlace_enable",
426 "(GPU) Show Interlaced Video",
427 "Show Interlaced Video",
428 "When enabled, games that run in high resolution video modes (480i, 512i) will produced interlaced video output. While this displays correctly on CRT televisions, it will produce artifacts on modern displays. When disabled, all video is output in progressive format.",
429 NULL,
430 "gpu_neon",
919cac88 431 {
432 { "disabled", NULL },
433 { "enabled", NULL },
fbe06628 434 { NULL, NULL },
919cac88 435 },
436 "disabled",
437 },
919cac88 438 {
f3c6ae10 439 "pcsx_rearmed_neon_enhancement_enable",
440 "(GPU) Enhanced Resolution (Slow)",
441 "Enhanced Resolution (Slow)",
442 "Render games that do not already run in high resolution video modes (480i, 512i) at twice the native internal resolution. Improves the fidelity of 3D models at the expense of increased performance requirements. 2D elements are generally unaffected by this setting.",
443 NULL,
444 "gpu_neon",
919cac88 445 {
446 { "disabled", NULL },
447 { "enabled", NULL },
fbe06628 448 { NULL, NULL },
919cac88 449 },
f3c6ae10 450 "disabled",
919cac88 451 },
452 {
f3c6ae10 453 "pcsx_rearmed_neon_enhancement_no_main",
454 "(GPU) Enhanced Resolution Speed Hack",
455 "Enhanced Resolution Speed Hack",
456 "Improves performance when 'Enhanced Resolution (Slow)' is enabled, but reduces compatibility and may cause rendering errors.",
457 NULL,
458 "gpu_neon",
919cac88 459 {
460 { "disabled", NULL },
461 { "enabled", NULL },
fbe06628 462 { NULL, NULL },
919cac88 463 },
464 "disabled",
465 },
f3c6ae10 466#endif /* GPU_NEON */
2d17de26 467#ifdef GPU_PEOPS
c8108d88 468 {
469 "pcsx_rearmed_show_gpu_peops_settings",
f3c6ae10 470 "Show Advanced P.E.Op.S. GPU Settings",
471 NULL,
472 "Show low-level configuration options for the P.E.Op.S. GPU plugin. Quick Menu may need to be toggled for this setting to take effect.",
473 NULL,
474 NULL,
c8108d88 475 {
476 { "disabled", NULL },
477 { "enabled", NULL },
fbe06628 478 { NULL, NULL },
c8108d88 479 },
480 "disabled",
481 },
482 {
6713b629 483 "pcsx_rearmed_gpu_peops_odd_even_bit",
c8108d88 484 "(GPU) Odd/Even Bit Hack",
f3c6ae10 485 "Odd/Even Bit Hack",
486 "A hack fix used to correct lock-ups that may occur in games such as Chrono Cross. Disable unless required.",
487 NULL,
488 "gpu_peops",
c8108d88 489 {
490 { "disabled", NULL },
491 { "enabled", NULL },
fbe06628 492 { NULL, NULL },
c8108d88 493 },
494 "disabled",
495 },
496 {
6713b629 497 "pcsx_rearmed_gpu_peops_expand_screen_width",
c8108d88 498 "(GPU) Expand Screen Width",
f3c6ae10 499 "Expand Screen Width",
500 "Intended for use only with Capcom 2D fighting games. Enlarges the display area at the right side of the screen to show all background elements without cut-off. May cause rendering errors.",
501 NULL,
502 "gpu_peops",
c8108d88 503 {
504 { "disabled", NULL },
505 { "enabled", NULL },
fbe06628 506 { NULL, NULL },
c8108d88 507 },
508 "disabled",
509 },
510 {
6713b629 511 "pcsx_rearmed_gpu_peops_ignore_brightness",
c8108d88 512 "(GPU) Ignore Brightness Color",
f3c6ae10 513 "Ignore Brightness Color",
514 "A hack fix used to repair black screens in Lunar Silver Star Story Complete when entering a house or a menu. Disable unless required.",
515 NULL,
516 "gpu_peops",
c8108d88 517 {
518 { "disabled", NULL },
519 { "enabled", NULL },
fbe06628 520 { NULL, NULL },
c8108d88 521 },
522 "disabled",
523 },
524 {
6713b629 525 "pcsx_rearmed_gpu_peops_disable_coord_check",
c8108d88 526 "(GPU) Disable Coordinate Check",
f3c6ae10 527 "Disable Coordinate Check",
528 "Legacy compatibility mode. May improve games that fail to run correctly on newer GPU hardware. Disable unless required.",
529 NULL,
530 "gpu_peops",
c8108d88 531 {
532 { "disabled", NULL },
533 { "enabled", NULL },
fbe06628 534 { NULL, NULL },
c8108d88 535 },
536 "disabled",
537 },
538 {
6713b629 539 "pcsx_rearmed_gpu_peops_lazy_screen_update",
c8108d88 540 "(GPU) Lazy Screen Update",
f3c6ae10 541 "Lazy Screen Update",
542 "A partial fix to prevent text box flickering in Dragon Warrior VII. May also improve Pandemonium 2. Disable unless required.",
543 NULL,
544 "gpu_peops",
c8108d88 545 {
546 { "disabled", NULL },
547 { "enabled", NULL },
fbe06628 548 { NULL, NULL },
c8108d88 549 },
550 "disabled",
551 },
c8108d88 552 {
6713b629 553 "pcsx_rearmed_gpu_peops_repeated_triangles",
f3c6ae10 554 "(GPU) Repeat Flat Tex Triangles",
555 "Repeat Flat Tex Triangles",
556 "A hack fix used to correct rendering errors in Star Wars: Dark Forces. Disable unless required.",
557 NULL,
558 "gpu_peops",
c8108d88 559 {
560 { "disabled", NULL },
561 { "enabled", NULL },
fbe06628 562 { NULL, NULL },
c8108d88 563 },
564 "disabled",
565 },
566 {
6713b629 567 "pcsx_rearmed_gpu_peops_quads_with_triangles",
f3c6ae10 568 "(GPU) Draw Tex-Quads as Triangles",
569 "Draw Tex-Quads as Triangles",
570 "Corrects graphical distortions that may occur when games utilize Gouraud Shading, at the expense of reduced texture quality. Disable unless required.",
571 NULL,
572 "gpu_peops",
c8108d88 573 {
574 { "disabled", NULL },
575 { "enabled", NULL },
fbe06628 576 { NULL, NULL },
c8108d88 577 },
578 "disabled",
579 },
580 {
6713b629 581 "pcsx_rearmed_gpu_peops_fake_busy_state",
f3c6ae10 582 "(GPU) Fake 'GPU Busy' States",
583 "Fake 'GPU Busy' States",
584 "Emulate the 'GPU is busy' (drawing primitives) status flag of the original hardware instead of assuming the GPU is always ready for commands. May improve compatibility at the expense of reduced performance. Disable unless required.",
585 NULL,
586 "gpu_peops",
c8108d88 587 {
588 { "disabled", NULL },
589 { "enabled", NULL },
fbe06628 590 { NULL, NULL },
c8108d88 591 },
592 "disabled",
593 },
f3c6ae10 594#endif /* GPU_PEOPS */
030d1121 595#ifdef GPU_UNAI
596 {
597 "pcsx_rearmed_show_gpu_unai_settings",
f3c6ae10 598 "Show Advanced UNAI GPU Settings",
599 NULL,
600 "Show low-level configuration options for the UNAI GPU plugin. Quick Menu may need to be toggled for this setting to take effect.",
601 NULL,
602 NULL,
030d1121 603 {
604 { "disabled", NULL },
605 { "enabled", NULL },
606 { NULL, NULL},
607 },
608 "disabled",
609 },
610 {
611 "pcsx_rearmed_gpu_unai_blending",
f3c6ae10 612 "(GPU) Texture Blending",
613 "Texture Blending",
614 "Enable alpha-based (and additive) texture blending. Required for various rendering effects, including transparency (e.g. water, shadows). Can be disabled to improve performance at the expense of severe display errors/inaccuracies.",
030d1121 615 NULL,
f3c6ae10 616 "gpu_unai",
030d1121 617 {
618 { "disabled", NULL },
619 { "enabled", NULL },
620 { NULL, NULL},
621 },
622 "enabled",
623 },
624 {
625 "pcsx_rearmed_gpu_unai_lighting",
f3c6ae10 626 "(GPU) Lighting Effects",
627 "Lighting Effects",
628 "Enable simulated lighting effects (via vertex coloring combined with texture mapping). Required by almost all 3D games. Can be disabled to improve performance at the expense of severe display errors/inaccuracies (missing shadows, flat textures, etc.).",
030d1121 629 NULL,
f3c6ae10 630 "gpu_unai",
030d1121 631 {
632 { "disabled", NULL },
633 { "enabled", NULL },
634 { NULL, NULL},
635 },
636 "enabled",
637 },
638 {
639 "pcsx_rearmed_gpu_unai_fast_lighting",
f3c6ae10 640 "(GPU) Fast Lighting",
641 "Fast Lighting",
642 "Improves performance when 'Lighting Effects' are enabled, but may cause moderate/severe rendering errors.",
030d1121 643 NULL,
f3c6ae10 644 "gpu_unai",
030d1121 645 {
646 { "disabled", NULL },
647 { "enabled", NULL },
648 { NULL, NULL},
649 },
6725614d 650 "disabled",
030d1121 651 },
652 {
f3c6ae10 653 "pcsx_rearmed_gpu_unai_scale_hires",
654 "(GPU) Hi-Res Downscaling",
655 "Hi-Res Downscaling",
656 "When enabled, games that run in high resolution video modes (480i, 512i) will be downscaled to 320x240. Can improve performance, and is recommended on devices with native 240p display resolutions.",
030d1121 657 NULL,
f3c6ae10 658 "gpu_unai",
030d1121 659 {
660 { "disabled", NULL },
661 { "enabled", NULL },
662 { NULL, NULL},
663 },
f3c6ae10 664#ifdef _MIYOO
665 "enabled",
666#else
030d1121 667 "disabled",
f3c6ae10 668#endif
030d1121 669 },
f3c6ae10 670#endif /* GPU_UNAI */
030d1121 671 {
f3c6ae10 672 "pcsx_rearmed_spu_reverb",
673 "Audio Reverb Effects",
674 "Reverb Effects",
675 "Enable emulation of the reverb feature provided by the PSX SPU. Can be disabled to improve performance at the expense of reduced audio quality/authenticity.",
030d1121 676 NULL,
f3c6ae10 677 "audio",
030d1121 678 {
679 { "disabled", NULL },
680 { "enabled", NULL },
f3c6ae10 681 { NULL, NULL },
030d1121 682 },
f3c6ae10 683#ifdef HAVE_PRE_ARMV7
030d1121 684 "disabled",
f3c6ae10 685#else
686 "enabled",
687#endif
030d1121 688 },
43047988 689 {
f3c6ae10 690 "pcsx_rearmed_spu_interpolation",
691 "Sound Interpolation",
692 NULL,
693 "Enable emulation of the in-built audio interpolation provided by the PSX SPU. 'Gaussian' sounds closest to original hardware. 'Simple' improves performance but reduces quality. 'Cubic' has the highest performance requirements but produces increased clarity. Can be disabled entirely for maximum performance, at the expense of greatly reduced audio quality.",
694 NULL,
695 "audio",
696 {
697 { "simple", "Simple" },
698 { "gaussian", "Gaussian" },
699 { "cubic", "Cubic" },
700 { "off", "disabled" },
701 { NULL, NULL },
702 },
703#ifdef HAVE_PRE_ARMV7
704 "off",
705#else
706 "simple",
707#endif
708 },
709 {
710 "pcsx_rearmed_nocdaudio",
711 "CD Audio",
712 NULL,
713 "Enable playback of CD (CD-DA) audio tracks. Can be disabled to improve performance in games that include CD audio, at the expense of missing music.",
714 NULL,
715 "audio",
43047988
JW
716 {
717 { "disabled", NULL },
718 { "enabled", NULL },
f3c6ae10 719 { NULL, NULL },
43047988 720 },
ad32ae17 721 "enabled",
43047988 722 },
c765eb86 723 {
f3c6ae10 724 "pcsx_rearmed_noxadecoding",
725 "XA Decoding",
726 NULL,
727 "Enable playback of XA (eXtended Architecture ADPCM) audio tracks. Can be disabled to improve performance in games that include XA audio, at the expense of missing music.",
728 NULL,
729 "audio",
c765eb86
JW
730 {
731 { "disabled", NULL },
f3c6ae10 732 { "enabled", NULL },
733 { NULL, NULL },
734 },
735 "enabled",
736 },
737 {
738 "pcsx_rearmed_show_input_settings",
739 "Show Input Settings",
740 NULL,
741 "Show configuration options for all input devices: analog response, Multitaps, light guns, etc. Quick Menu may need to be toggled for this setting to take effect.",
742 NULL,
743 NULL,
744 {
745 { "disabled", NULL },
746 { "enabled", NULL },
747 { NULL, NULL },
c765eb86
JW
748 },
749 "disabled",
750 },
919cac88 751 {
f3c6ae10 752 "pcsx_rearmed_analog_axis_modifier",
753 "Analog Axis Bounds",
754 NULL,
755 "Specify range limits for the left and right analog sticks when input device is set to 'analog' or 'dualshock'. 'Square' bounds improve input response when using controllers with highly circular ranges that are unable to fully saturate the X and Y axes at 45 degree deflections.",
756 NULL,
757 "input",
758 {
759 { "circle", "Circle" },
760 { "square", "Square" },
761 { NULL, NULL },
762 },
763 "circle",
764 },
765 {
766 "pcsx_rearmed_vibration",
767 "Rumble Effects",
768 NULL,
769 "Enable haptic feedback when using a rumble-equipped gamepad with input device set to 'dualshock'.",
770 NULL,
771 "input",
919cac88 772 {
773 { "disabled", NULL },
774 { "enabled", NULL },
fbe06628 775 { NULL, NULL },
919cac88 776 },
f3c6ae10 777 "enabled",
778 },
779 {
780 "pcsx_rearmed_multitap",
781 "Multitap Mode (Restart)",
782 NULL,
783 "Connect a virtual PSX Multitap peripheral to either controller 'Port 1' or controller 'Port 2' for 5 player simultaneous input, or to both 'Ports 1 and 2' for 8 player input. Mutlitap usage requires compatible games. To avoid input defects, option should be disabled when running games that have no support for Multitap features.",
784 NULL,
785 "input",
786 {
787 { "disabled", NULL },
788 { "port 1", "Port 1" },
789 { "port 2", "Port 2" },
790 { "ports 1 and 2", "Ports 1 and 2" },
791 { NULL, NULL },
792 },
793 "disabled",
794 },
795 {
796 "pcsx_rearmed_negcon_deadzone",
797 "NegCon Twist Deadzone",
798 NULL,
799 "Set the deadzone of the RetroPad left analog stick when simulating the 'twist' action of emulated neGcon Controllers. Used to eliminate drift/unwanted input.",
800 NULL,
801 "input",
802 {
803 { "0", "0%" },
804 { "3", "3%" },
805 { "5", "5%" },
806 { "7", "7%" },
807 { "10", "10%" },
808 { "13", "13%" },
809 { "15", "15%" },
810 { "17", "17%" },
811 { "20", "20%" },
812 { "23", "23%" },
813 { "25", "25%" },
814 { "27", "27%" },
815 { "30", "30%" },
816 { NULL, NULL },
817 },
818 "0",
819 },
820 {
821 "pcsx_rearmed_negcon_response",
822 "NegCon Twist Response",
823 NULL,
824 "Specify the analog response when using a RetroPad left analog stick to simulate the 'twist' action of emulated neGcon Controllers.",
825 NULL,
826 "input",
827 {
828 { "linear", "Linear" },
829 { "quadratic", "Quadratic" },
830 { "cubic", "Cubic" },
831 { NULL, NULL },
832 },
833 "linear",
834 },
835 {
836 "pcsx_rearmed_input_sensitivity",
837 "Mouse Sensitivity",
838 NULL,
839 "Adjust responsiveness of emulated 'mouse' input devices.",
840 NULL,
841 "input",
842 {
843 { "0.05", NULL },
844 { "0.10", NULL },
845 { "0.15", NULL },
846 { "0.20", NULL },
847 { "0.25", NULL },
848 { "0.30", NULL },
849 { "0.35", NULL },
850 { "0.40", NULL },
851 { "0.45", NULL },
852 { "0.50", NULL },
853 { "0.55", NULL },
854 { "0.60", NULL },
855 { "0.65", NULL },
856 { "0.70", NULL },
857 { "0.75", NULL },
858 { "0.80", NULL },
859 { "0.85", NULL },
860 { "0.90", NULL },
861 { "0.95", NULL },
862 { "1.00", NULL },
863 { "1.05", NULL },
864 { "1.10", NULL },
865 { "1.15", NULL },
866 { "1.20", NULL },
867 { "1.25", NULL },
868 { "1.30", NULL },
869 { "1.35", NULL },
870 { "1.40", NULL },
871 { "1.45", NULL },
872 { "1.50", NULL },
873 { "1.55", NULL },
874 { "1.60", NULL },
875 { "1.65", NULL },
876 { "1.70", NULL },
877 { "1.75", NULL },
878 { "1.80", NULL },
879 { "1.85", NULL },
880 { "1.90", NULL },
881 { "1.95", NULL },
882 { "2.00", NULL },
883 },
884 "1.00",
885 },
886 {
887 "pcsx_rearmed_gunconadjustx",
888 "Guncon X Axis Offset",
889 NULL,
890 "Apply an X axis offset to light gun input when emulating a Guncon device. Can be used to correct aiming misalignments.",
891 NULL,
892 "input",
893 {
894 { "-25", NULL },
895 { "-24", NULL },
896 { "-23", NULL },
897 { "-22", NULL },
898 { "-21", NULL },
899 { "-20", NULL },
900 { "-19", NULL },
901 { "-18", NULL },
902 { "-17", NULL },
903 { "-16", NULL },
904 { "-15", NULL },
905 { "-14", NULL },
906 { "-13", NULL },
907 { "-12", NULL },
908 { "-11", NULL },
909 { "-10", NULL },
910 { "-9", NULL },
911 { "-8", NULL },
912 { "-7", NULL },
913 { "-6", NULL },
914 { "-5", NULL },
915 { "-4", NULL },
916 { "-3", NULL },
917 { "-2", NULL },
918 { "-1", NULL },
919 { "0", NULL },
920 { "1", NULL },
921 { "2", NULL },
922 { "3", NULL },
923 { "4", NULL },
924 { "5", NULL },
925 { "6", NULL },
926 { "7", NULL },
927 { "8", NULL },
928 { "9", NULL },
929 { "10", NULL },
930 { "11", NULL },
931 { "12", NULL },
932 { "13", NULL },
933 { "14", NULL },
934 { "15", NULL },
935 { "16", NULL },
936 { "17", NULL },
937 { "18", NULL },
938 { "19", NULL },
939 { "20", NULL },
940 { "21", NULL },
941 { "22", NULL },
942 { "23", NULL },
943 { "24", NULL },
944 { "25", NULL },
945 { NULL, NULL },
946 },
947 "0",
948 },
949 {
950 "pcsx_rearmed_gunconadjusty",
951 "Guncon Y Axis Offset",
952 NULL,
953 "Apply a Y axis offset to light gun input when emulating a Guncon device. Can be used to correct aiming misalignments.",
954 NULL,
955 "input",
956 {
957 { "-25", NULL },
958 { "-24", NULL },
959 { "-23", NULL },
960 { "-22", NULL },
961 { "-21", NULL },
962 { "-20", NULL },
963 { "-19", NULL },
964 { "-18", NULL },
965 { "-17", NULL },
966 { "-16", NULL },
967 { "-15", NULL },
968 { "-14", NULL },
969 { "-13", NULL },
970 { "-12", NULL },
971 { "-11", NULL },
972 { "-10", NULL },
973 { "-9", NULL },
974 { "-8", NULL },
975 { "-7", NULL },
976 { "-6", NULL },
977 { "-5", NULL },
978 { "-4", NULL },
979 { "-3", NULL },
980 { "-2", NULL },
981 { "-1", NULL },
982 { "0", NULL },
983 { "1", NULL },
984 { "2", NULL },
985 { "3", NULL },
986 { "4", NULL },
987 { "5", NULL },
988 { "6", NULL },
989 { "7", NULL },
990 { "8", NULL },
991 { "9", NULL },
992 { "10", NULL },
993 { "11", NULL },
994 { "12", NULL },
995 { "13", NULL },
996 { "14", NULL },
997 { "15", NULL },
998 { "16", NULL },
999 { "17", NULL },
1000 { "18", NULL },
1001 { "19", NULL },
1002 { "20", NULL },
1003 { "21", NULL },
1004 { "22", NULL },
1005 { "23", NULL },
1006 { "24", NULL },
1007 { "25", NULL },
1008 { NULL, NULL },
1009 },
1010 "0",
919cac88 1011 },
1012 {
f3c6ae10 1013 "pcsx_rearmed_gunconadjustratiox",
1014 "Guncon X Axis Response",
1015 NULL,
1016 "Adjust relative magnitude of horizontal light gun motion when emulating a Guncon device. Can be used to correct aiming misalignments.",
1017 NULL,
1018 "input",
919cac88 1019 {
f3c6ae10 1020 { "0.75", NULL },
1021 { "0.76", NULL },
1022 { "0.77", NULL },
1023 { "0.78", NULL },
1024 { "0.79", NULL },
1025 { "0.80", NULL },
1026 { "0.81", NULL },
1027 { "0.82", NULL },
1028 { "0.83", NULL },
1029 { "0.84", NULL },
1030 { "0.85", NULL },
1031 { "0.86", NULL },
1032 { "0.87", NULL },
1033 { "0.88", NULL },
1034 { "0.89", NULL },
1035 { "0.90", NULL },
1036 { "0.91", NULL },
1037 { "0.92", NULL },
1038 { "0.93", NULL },
1039 { "0.94", NULL },
1040 { "0.95", NULL },
1041 { "0.96", NULL },
1042 { "0.97", NULL },
1043 { "0.98", NULL },
1044 { "0.99", NULL },
1045 { "1.00", NULL },
1046 { "1.01", NULL },
1047 { "1.02", NULL },
1048 { "1.03", NULL },
1049 { "1.04", NULL },
1050 { "1.05", NULL },
1051 { "1.06", NULL },
1052 { "1.07", NULL },
1053 { "1.08", NULL },
1054 { "1.09", NULL },
1055 { "1.10", NULL },
1056 { "1.11", NULL },
1057 { "1.12", NULL },
1058 { "1.13", NULL },
1059 { "1.14", NULL },
1060 { "1.15", NULL },
1061 { "1.16", NULL },
1062 { "1.17", NULL },
1063 { "1.18", NULL },
1064 { "1.19", NULL },
1065 { "1.20", NULL },
1066 { "1.21", NULL },
1067 { "1.22", NULL },
1068 { "1.23", NULL },
1069 { "1.24", NULL },
1070 { "1.25", NULL },
fbe06628 1071 { NULL, NULL },
919cac88 1072 },
f3c6ae10 1073 "1.00",
919cac88 1074 },
1075 {
f3c6ae10 1076 "pcsx_rearmed_gunconadjustratioy",
1077 "Guncon Y Axis Response",
1078 NULL,
1079 "Adjust relative magnitude of vertical light gun motion when emulating a Guncon device. Can be used to correct aiming misalignments.",
919cac88 1080 NULL,
f3c6ae10 1081 "input",
919cac88 1082 {
f3c6ae10 1083 { "0.75", NULL },
1084 { "0.76", NULL },
1085 { "0.77", NULL },
1086 { "0.78", NULL },
1087 { "0.79", NULL },
1088 { "0.80", NULL },
1089 { "0.81", NULL },
1090 { "0.82", NULL },
1091 { "0.83", NULL },
1092 { "0.84", NULL },
1093 { "0.85", NULL },
1094 { "0.86", NULL },
1095 { "0.87", NULL },
1096 { "0.88", NULL },
1097 { "0.89", NULL },
1098 { "0.90", NULL },
1099 { "0.91", NULL },
1100 { "0.92", NULL },
1101 { "0.93", NULL },
1102 { "0.94", NULL },
1103 { "0.95", NULL },
1104 { "0.96", NULL },
1105 { "0.97", NULL },
1106 { "0.98", NULL },
1107 { "0.99", NULL },
1108 { "1.00", NULL },
1109 { "1.01", NULL },
1110 { "1.02", NULL },
1111 { "1.03", NULL },
1112 { "1.04", NULL },
1113 { "1.05", NULL },
1114 { "1.06", NULL },
1115 { "1.07", NULL },
1116 { "1.08", NULL },
1117 { "1.09", NULL },
1118 { "1.10", NULL },
1119 { "1.11", NULL },
1120 { "1.12", NULL },
1121 { "1.13", NULL },
1122 { "1.14", NULL },
1123 { "1.15", NULL },
1124 { "1.16", NULL },
1125 { "1.17", NULL },
1126 { "1.18", NULL },
1127 { "1.19", NULL },
1128 { "1.20", NULL },
1129 { "1.21", NULL },
1130 { "1.22", NULL },
1131 { "1.23", NULL },
1132 { "1.24", NULL },
1133 { "1.25", NULL },
fbe06628 1134 { NULL, NULL },
919cac88 1135 },
f3c6ae10 1136 "1.00",
919cac88 1137 },
919cac88 1138 {
1139 "pcsx_rearmed_pe2_fix",
1140 "Parasite Eve 2/Vandal Hearts 1/2 Fix",
1141 NULL,
f3c6ae10 1142 "Hack fix required for correct operation of Parasite Eve 2 and Vandal Hearts 1/2. Should be disabled for all other games.",
1143 NULL,
1144 "compat_hack",
7a811716 1145 {
1146 { "disabled", NULL },
1147 { "enabled", NULL },
1148 { NULL, NULL },
1149 },
1150 "disabled",
1151 },
919cac88 1152 {
1153 "pcsx_rearmed_inuyasha_fix",
1154 "InuYasha Sengoku Battle Fix",
1155 NULL,
f3c6ae10 1156 "Hack fix required for correct operation of Inuyasha Sengoku Otogi Kassen. Should be disabled for all other games.",
1157 NULL,
1158 "compat_hack",
919cac88 1159 {
1160 { "disabled", NULL },
1161 { "enabled", NULL },
fbe06628 1162 { NULL, NULL },
919cac88 1163 },
1164 "disabled",
1165 },
919cac88 1166 {
f3c6ae10 1167 "pcsx_rearmed_spuirq",
1168 "SPU IRQ Always Enabled",
919cac88 1169 NULL,
f3c6ae10 1170 "Hack for certain games where events tied to audio cues do not trigger correctly. Fixes unopenable doors in Alien Resurrection. Fixes desynchronised FMV audio in Legend of Mana. Should be disabled unless required.",
1171 NULL,
1172 "compat_hack",
919cac88 1173 {
1174 { "disabled", NULL },
1175 { "enabled", NULL },
fbe06628 1176 { NULL, NULL },
919cac88 1177 },
f3c6ae10 1178 "disabled",
919cac88 1179 },
1180 {
f3c6ae10 1181 "pcsx_rearmed_icache_emulation",
1182 "Instruction Cache Emulation",
919cac88 1183 NULL,
f3c6ae10 1184 "Enable emulation of the PSX CPU instruction cache. Improves accuracy at the expense of increased performance overheads. Required for Formula One 2001, Formula One Arcade and Formula One 99. May cause certain games to fail (e.g. Spyro 2: Gateway to Glimmer, PAL version) so should be disabled unless needed. [Interpreter only and partial on lightrec, unsupported when using ARMv7 backend]",
1185 NULL,
1186 "compat_hack",
919cac88 1187 {
1188 { "disabled", NULL },
1189 { "enabled", NULL },
fbe06628 1190 { NULL, NULL },
919cac88 1191 },
f3c6ae10 1192 "disabled",
919cac88 1193 },
f3c6ae10 1194#if !defined(DRC_DISABLE) && !defined(LIGHTREC)
34af0fff 1195 {
f3c6ae10 1196 "pcsx_rearmed_nocompathacks",
1197 "Disable Automatic Compatibility Hacks",
1198 NULL,
1199 "By default, PCSX-ReARMed will apply auxiliary compatibility hacks automatically, based on the currently loaded content. This behaviour is required for correct operation, but may be disabled if desired.",
1200 NULL,
1201 "compat_hack",
34af0fff 1202 {
1203 { "disabled", NULL },
1204 { "enabled", NULL },
1205 { NULL, NULL },
1206 },
1207 "disabled",
1208 },
919cac88 1209 {
1210 "pcsx_rearmed_nosmccheck",
1211 "(Speed Hack) Disable SMC Checks",
f3c6ae10 1212 "Disable SMC Checks",
1213 "Will cause crashes when loading, and lead to memory card failure.",
1214 NULL,
1215 "speed_hack",
919cac88 1216 {
1217 { "disabled", NULL },
1218 { "enabled", NULL },
fbe06628 1219 { NULL, NULL },
919cac88 1220 },
1221 "disabled",
1222 },
1223 {
1224 "pcsx_rearmed_gteregsunneeded",
f3c6ae10 1225 "(Speed Hack) Assume GTE Registers Unneeded",
1226 "Assume GTE Registers Unneeded",
1227 "May cause rendering errors.",
1228 NULL,
1229 "speed_hack",
919cac88 1230 {
1231 { "disabled", NULL },
1232 { "enabled", NULL },
fbe06628 1233 { NULL, NULL },
919cac88 1234 },
1235 "disabled",
1236 },
1237 {
1238 "pcsx_rearmed_nogteflags",
1239 "(Speed Hack) Disable GTE Flags",
f3c6ae10 1240 "Disable GTE Flags",
1241 "Will cause rendering errors.",
1242 NULL,
1243 "speed_hack",
919cac88 1244 {
1245 { "disabled", NULL },
1246 { "enabled", NULL },
38114665
ÖK
1247 { NULL, NULL },
1248 },
fbe06628 1249 "disabled",
38114665 1250 },
630b122b 1251 {
1252 "pcsx_rearmed_nostalls",
f3c6ae10 1253 "(Speed Hack) Disable CPU/GTE Stalls",
1254 "Disable CPU/GTE Stalls",
1255 "Will cause some games to run too quickly.",
1256 NULL,
1257 "speed_hack",
630b122b 1258 {
1259 { "disabled", NULL },
1260 { "enabled", NULL },
1261 { NULL, NULL },
1262 },
1263 "disabled",
1264 },
1265#endif /* !DRC_DISABLE && !LIGHTREC */
f3c6ae10 1266 { NULL, NULL, NULL, NULL, NULL, NULL, {{0}}, NULL },
1267};
38114665 1268
f3c6ae10 1269struct retro_core_options_v2 options_us = {
1270 option_cats_us,
1271 option_defs_us
38114665
ÖK
1272};
1273
919cac88 1274/*
1275 ********************************
1276 * Language Mapping
1277 ********************************
1278*/
1279
fbe06628 1280#ifndef HAVE_NO_LANGEXTRA
f3c6ae10 1281struct retro_core_options_v2 *options_intl[RETRO_LANGUAGE_LAST] = {
1282 &options_us, /* RETRO_LANGUAGE_ENGLISH */
1283 NULL, /* RETRO_LANGUAGE_JAPANESE */
1284 NULL, /* RETRO_LANGUAGE_FRENCH */
1285 NULL, /* RETRO_LANGUAGE_SPANISH */
1286 NULL, /* RETRO_LANGUAGE_GERMAN */
1287 NULL, /* RETRO_LANGUAGE_ITALIAN */
1288 NULL, /* RETRO_LANGUAGE_DUTCH */
1289 NULL, /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */
1290 NULL, /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */
1291 NULL, /* RETRO_LANGUAGE_RUSSIAN */
1292 NULL, /* RETRO_LANGUAGE_KOREAN */
1293 NULL, /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */
1294 NULL, /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */
1295 NULL, /* RETRO_LANGUAGE_ESPERANTO */
1296 NULL, /* RETRO_LANGUAGE_POLISH */
1297 NULL, /* RETRO_LANGUAGE_VIETNAMESE */
1298 NULL, /* RETRO_LANGUAGE_ARABIC */
1299 NULL, /* RETRO_LANGUAGE_GREEK */
1300 &options_tr, /* RETRO_LANGUAGE_TURKISH */
919cac88 1301};
fbe06628 1302#endif
919cac88 1303
1304/*
1305 ********************************
1306 * Functions
1307 ********************************
1308*/
1309
1310/* Handles configuration/setting of core options.
fbe06628 1311 * Should be called as early as possible - ideally inside
1312 * retro_set_environment(), and no later than retro_load_game()
919cac88 1313 * > We place the function body in the header to avoid the
1314 * necessity of adding more .c files (i.e. want this to
1315 * be as painless as possible for core devs)
1316 */
1317
f3c6ae10 1318static INLINE void libretro_set_core_options(retro_environment_t environ_cb,
1319 bool *categories_supported)
919cac88 1320{
f3c6ae10 1321 unsigned version = 0;
1322#ifndef HAVE_NO_LANGEXTRA
1323 unsigned language = 0;
1324#endif
919cac88 1325
f3c6ae10 1326 if (!environ_cb || !categories_supported)
919cac88 1327 return;
1328
f3c6ae10 1329 *categories_supported = false;
1330
1331 if (!environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version))
1332 version = 0;
1333
1334 if (version >= 2)
919cac88 1335 {
fbe06628 1336#ifndef HAVE_NO_LANGEXTRA
f3c6ae10 1337 struct retro_core_options_v2_intl core_options_intl;
919cac88 1338
f3c6ae10 1339 core_options_intl.us = &options_us;
919cac88 1340 core_options_intl.local = NULL;
1341
1342 if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1343 (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
f3c6ae10 1344 core_options_intl.local = options_intl[language];
919cac88 1345
f3c6ae10 1346 *categories_supported = environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL,
1347 &core_options_intl);
fbe06628 1348#else
f3c6ae10 1349 *categories_supported = environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2,
1350 &options_us);
fbe06628 1351#endif
919cac88 1352 }
1353 else
1354 {
f3c6ae10 1355 size_t i, j;
919cac88 1356 size_t option_index = 0;
1357 size_t num_options = 0;
f3c6ae10 1358 struct retro_core_option_definition
1359 *option_v1_defs_us = NULL;
1360#ifndef HAVE_NO_LANGEXTRA
1361 size_t num_options_intl = 0;
1362 struct retro_core_option_v2_definition
1363 *option_defs_intl = NULL;
1364 struct retro_core_option_definition
1365 *option_v1_defs_intl = NULL;
1366 struct retro_core_options_intl
1367 core_options_v1_intl;
1368#endif
919cac88 1369 struct retro_variable *variables = NULL;
1370 char **values_buf = NULL;
1371
f3c6ae10 1372 /* Determine total number of options */
919cac88 1373 while (true)
1374 {
1375 if (option_defs_us[num_options].key)
1376 num_options++;
1377 else
1378 break;
1379 }
1380
f3c6ae10 1381 if (version >= 1)
1382 {
1383 /* Allocate US array */
1384 option_v1_defs_us = (struct retro_core_option_definition *)
1385 calloc(num_options + 1, sizeof(struct retro_core_option_definition));
1386
1387 /* Copy parameters from option_defs_us array */
1388 for (i = 0; i < num_options; i++)
1389 {
1390 struct retro_core_option_v2_definition *option_def_us = &option_defs_us[i];
1391 struct retro_core_option_value *option_values = option_def_us->values;
1392 struct retro_core_option_definition *option_v1_def_us = &option_v1_defs_us[i];
1393 struct retro_core_option_value *option_v1_values = option_v1_def_us->values;
919cac88 1394
f3c6ae10 1395 option_v1_def_us->key = option_def_us->key;
1396 option_v1_def_us->desc = option_def_us->desc;
1397 option_v1_def_us->info = option_def_us->info;
1398 option_v1_def_us->default_value = option_def_us->default_value;
919cac88 1399
f3c6ae10 1400 /* Values must be copied individually... */
1401 while (option_values->value)
1402 {
1403 option_v1_values->value = option_values->value;
1404 option_v1_values->label = option_values->label;
919cac88 1405
f3c6ae10 1406 option_values++;
1407 option_v1_values++;
1408 }
1409 }
919cac88 1410
f3c6ae10 1411#ifndef HAVE_NO_LANGEXTRA
1412 if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
1413 (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH) &&
1414 options_intl[language])
1415 option_defs_intl = options_intl[language]->definitions;
919cac88 1416
f3c6ae10 1417 if (option_defs_intl)
919cac88 1418 {
f3c6ae10 1419 /* Determine number of intl options */
919cac88 1420 while (true)
1421 {
f3c6ae10 1422 if (option_defs_intl[num_options_intl].key)
1423 num_options_intl++;
919cac88 1424 else
1425 break;
1426 }
1427
f3c6ae10 1428 /* Allocate intl array */
1429 option_v1_defs_intl = (struct retro_core_option_definition *)
1430 calloc(num_options_intl + 1, sizeof(struct retro_core_option_definition));
1431
1432 /* Copy parameters from option_defs_intl array */
1433 for (i = 0; i < num_options_intl; i++)
919cac88 1434 {
f3c6ae10 1435 struct retro_core_option_v2_definition *option_def_intl = &option_defs_intl[i];
1436 struct retro_core_option_value *option_values = option_def_intl->values;
1437 struct retro_core_option_definition *option_v1_def_intl = &option_v1_defs_intl[i];
1438 struct retro_core_option_value *option_v1_values = option_v1_def_intl->values;
1439
1440 option_v1_def_intl->key = option_def_intl->key;
1441 option_v1_def_intl->desc = option_def_intl->desc;
1442 option_v1_def_intl->info = option_def_intl->info;
1443 option_v1_def_intl->default_value = option_def_intl->default_value;
1444
1445 /* Values must be copied individually... */
1446 while (option_values->value)
1447 {
1448 option_v1_values->value = option_values->value;
1449 option_v1_values->label = option_values->label;
1450
1451 option_values++;
1452 option_v1_values++;
1453 }
1454 }
1455 }
919cac88 1456
f3c6ae10 1457 core_options_v1_intl.us = option_v1_defs_us;
1458 core_options_v1_intl.local = option_v1_defs_intl;
919cac88 1459
f3c6ae10 1460 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_v1_intl);
1461#else
1462 environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, option_v1_defs_us);
1463#endif
1464 }
1465 else
1466 {
1467 /* Allocate arrays */
1468 variables = (struct retro_variable *)calloc(num_options + 1,
1469 sizeof(struct retro_variable));
1470 values_buf = (char **)calloc(num_options, sizeof(char *));
1471
1472 if (!variables || !values_buf)
1473 goto error;
1474
1475 /* Copy parameters from option_defs_us array */
1476 for (i = 0; i < num_options; i++)
1477 {
1478 const char *key = option_defs_us[i].key;
1479 const char *desc = option_defs_us[i].desc;
1480 const char *default_value = option_defs_us[i].default_value;
1481 struct retro_core_option_value *values = option_defs_us[i].values;
1482 size_t buf_len = 3;
1483 size_t default_index = 0;
919cac88 1484
f3c6ae10 1485 values_buf[i] = NULL;
919cac88 1486
f3c6ae10 1487 /* Skip options that are irrelevant when using the
1488 * old style core options interface */
1489 if ((strcmp(key, "pcsx_rearmed_show_input_settings") == 0) ||
1490 (strcmp(key, "pcsx_rearmed_show_gpu_peops_settings") == 0) ||
1491 (strcmp(key, "pcsx_rearmed_show_gpu_unai_settings") == 0))
1492 continue;
1493
1494 if (desc)
1495 {
1496 size_t num_values = 0;
1497
1498 /* Determine number of values */
1499 while (true)
1500 {
1501 if (values[num_values].value)
1502 {
1503 /* Check if this is the default value */
1504 if (default_value)
1505 if (strcmp(values[num_values].value, default_value) == 0)
1506 default_index = num_values;
1507
1508 buf_len += strlen(values[num_values].value);
1509 num_values++;
1510 }
1511 else
1512 break;
1513 }
919cac88 1514
f3c6ae10 1515 /* Build values string */
1516 if (num_values > 0)
919cac88 1517 {
f3c6ae10 1518 buf_len += num_values - 1;
1519 buf_len += strlen(desc);
1520
1521 values_buf[i] = (char *)calloc(buf_len, sizeof(char));
1522 if (!values_buf[i])
1523 goto error;
1524
1525 strcpy(values_buf[i], desc);
1526 strcat(values_buf[i], "; ");
1527
1528 /* Default value goes first */
1529 strcat(values_buf[i], values[default_index].value);
1530
1531 /* Add remaining values */
1532 for (j = 0; j < num_values; j++)
919cac88 1533 {
f3c6ae10 1534 if (j != default_index)
1535 {
1536 strcat(values_buf[i], "|");
1537 strcat(values_buf[i], values[j].value);
1538 }
919cac88 1539 }
1540 }
1541 }
f3c6ae10 1542
1543 variables[option_index].key = key;
1544 variables[option_index].value = values_buf[i];
1545 option_index++;
919cac88 1546 }
1547
f3c6ae10 1548 /* Set variables */
1549 environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
919cac88 1550 }
1551
919cac88 1552error:
919cac88 1553 /* Clean up */
f3c6ae10 1554
1555 if (option_v1_defs_us)
1556 {
1557 free(option_v1_defs_us);
1558 option_v1_defs_us = NULL;
1559 }
1560
1561#ifndef HAVE_NO_LANGEXTRA
1562 if (option_v1_defs_intl)
1563 {
1564 free(option_v1_defs_intl);
1565 option_v1_defs_intl = NULL;
1566 }
1567#endif
1568
919cac88 1569 if (values_buf)
1570 {
1571 for (i = 0; i < num_options; i++)
1572 {
1573 if (values_buf[i])
1574 {
1575 free(values_buf[i]);
1576 values_buf[i] = NULL;
1577 }
1578 }
1579
1580 free(values_buf);
1581 values_buf = NULL;
1582 }
1583
1584 if (variables)
1585 {
1586 free(variables);
1587 variables = NULL;
1588 }
1589 }
1590}
1591
1592#ifdef __cplusplus
1593}
1594#endif
1595
1596#endif