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