1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977
|
/* RetroArch - A frontend for libretro.
* Copyright (C) 2011-2017 - Daniel De Matteis
* Copyright (C) 2016-2019 - Brad Parker
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <string.h>
#include <lrc_hash.h>
#include <string/stdstring.h>
#include <libretro.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "msg_hash.h"
#if defined(_MSC_VER) && !defined(_XBOX) && (_MSC_VER >= 1500 && _MSC_VER < 1900)
#if (_MSC_VER >= 1700)
/* https://support.microsoft.com/en-us/kb/980263 */
#pragma execution_character_set("utf-8")
#endif
#pragma warning(disable:4566)
#endif
/* TODO/FIXME - static public global variable */
static unsigned uint_user_language;
int msg_hash_get_help_enum(enum msg_hash_enums msg, char *s, size_t len)
{
int ret = msg_hash_get_help_us_enum(msg, s, len);
/* Replace line-breaks with "empty line-breaks" for readability */
const char *temp = string_replace_substring(s, strlen(s),
"\n", STRLEN_CONST("\n"),
"\n \n", STRLEN_CONST("\n \n"));
if (temp)
{
strlcpy(s, temp, len);
free((void*)temp);
}
return ret;
}
const char *get_user_language_iso639_1(bool limit)
{
switch (uint_user_language)
{
case RETRO_LANGUAGE_FRENCH:
return "fr";
case RETRO_LANGUAGE_GERMAN:
return "de";
case RETRO_LANGUAGE_SPANISH:
return "es";
case RETRO_LANGUAGE_ITALIAN:
return "it";
case RETRO_LANGUAGE_PORTUGUESE_BRAZIL:
if (limit)
return "pt";
return "pt_br";
case RETRO_LANGUAGE_PORTUGUESE_PORTUGAL:
if (limit)
return "pt";
return "pt_pt";
case RETRO_LANGUAGE_DUTCH:
return "nl";
case RETRO_LANGUAGE_ESPERANTO:
return "eo";
case RETRO_LANGUAGE_POLISH:
return "pl";
case RETRO_LANGUAGE_JAPANESE:
return "ja";
case RETRO_LANGUAGE_KOREAN:
return "ko";
case RETRO_LANGUAGE_VIETNAMESE:
return "vi";
case RETRO_LANGUAGE_CHINESE_SIMPLIFIED:
if (limit)
return "zh";
return "zh_cn";
case RETRO_LANGUAGE_CHINESE_TRADITIONAL:
if (limit)
return "zh";
return "zh_tw";
case RETRO_LANGUAGE_ARABIC:
return "ar";
case RETRO_LANGUAGE_GREEK:
return "el";
case RETRO_LANGUAGE_TURKISH:
return "tr";
case RETRO_LANGUAGE_SLOVAK:
return "sk";
case RETRO_LANGUAGE_RUSSIAN:
return "ru";
case RETRO_LANGUAGE_PERSIAN:
return "fa";
case RETRO_LANGUAGE_HEBREW:
return "he";
case RETRO_LANGUAGE_ASTURIAN:
return "ast";
case RETRO_LANGUAGE_FINNISH:
return "fi";
case RETRO_LANGUAGE_INDONESIAN:
return "id";
case RETRO_LANGUAGE_SWEDISH:
return "sv";
case RETRO_LANGUAGE_UKRAINIAN:
return "uk";
case RETRO_LANGUAGE_CZECH:
return "cs";
case RETRO_LANGUAGE_CATALAN_VALENCIA:
if (limit)
return "ca";
return "ca_ES@valencia";
case RETRO_LANGUAGE_CATALAN:
return "ca";
case RETRO_LANGUAGE_BRITISH_ENGLISH:
if (limit)
return "en";
return "en_gb";
case RETRO_LANGUAGE_HUNGARIAN:
return "hu";
case RETRO_LANGUAGE_BELARUSIAN:
return "be";
case RETRO_LANGUAGE_GALICIAN:
return "gl";
case RETRO_LANGUAGE_NORWEGIAN:
return "no";
}
return "en";
}
#ifdef HAVE_LANGEXTRA
static const char *msg_hash_to_str_he(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_he.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_sk(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_sk.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_uk(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_uk.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_eo(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_eo.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_pl(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_pl.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_fi(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_fi.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_hu(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_hu.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_be(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_be.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_en(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_en.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_it(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_it.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_fa(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_fa.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_ast(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_ast.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_nl(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_nl.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_sv(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_sv.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_id(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_id.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_cs(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_cs.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_ar(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_ar.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_fr(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_fr.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_cht(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_cht.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_de(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_de.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_es(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_es.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_ca(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_ca.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_el(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_el.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_jp(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_ja.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_ko(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_ko.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_pt_pt(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_pt_pt.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_ru(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_ru.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_tr(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_tr.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_val(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_val.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_vn(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_vn.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_chs(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_chs.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_pt_br(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_pt_br.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_gl(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_gl.h"
default:
break;
}
return "null";
}
static const char *msg_hash_to_str_no(enum msg_hash_enums msg)
{
switch (msg)
{
#include "intl/msg_hash_no.h"
default:
break;
}
return "null";
}
#endif
const char *msg_hash_to_str(enum msg_hash_enums msg)
{
const char *ret = NULL;
#ifdef HAVE_LANGEXTRA
switch (uint_user_language)
{
case RETRO_LANGUAGE_FRENCH:
ret = msg_hash_to_str_fr(msg);
break;
case RETRO_LANGUAGE_GERMAN:
ret = msg_hash_to_str_de(msg);
break;
case RETRO_LANGUAGE_SPANISH:
ret = msg_hash_to_str_es(msg);
break;
case RETRO_LANGUAGE_ITALIAN:
ret = msg_hash_to_str_it(msg);
break;
case RETRO_LANGUAGE_PORTUGUESE_BRAZIL:
ret = msg_hash_to_str_pt_br(msg);
break;
case RETRO_LANGUAGE_PORTUGUESE_PORTUGAL:
ret = msg_hash_to_str_pt_pt(msg);
break;
case RETRO_LANGUAGE_DUTCH:
ret = msg_hash_to_str_nl(msg);
break;
case RETRO_LANGUAGE_ESPERANTO:
ret = msg_hash_to_str_eo(msg);
break;
case RETRO_LANGUAGE_POLISH:
ret = msg_hash_to_str_pl(msg);
break;
case RETRO_LANGUAGE_RUSSIAN:
ret = msg_hash_to_str_ru(msg);
break;
case RETRO_LANGUAGE_JAPANESE:
ret = msg_hash_to_str_jp(msg);
break;
case RETRO_LANGUAGE_KOREAN:
ret = msg_hash_to_str_ko(msg);
break;
case RETRO_LANGUAGE_VIETNAMESE:
ret = msg_hash_to_str_vn(msg);
break;
case RETRO_LANGUAGE_CHINESE_SIMPLIFIED:
ret = msg_hash_to_str_chs(msg);
break;
case RETRO_LANGUAGE_CHINESE_TRADITIONAL:
ret = msg_hash_to_str_cht(msg);
break;
case RETRO_LANGUAGE_ARABIC:
ret = msg_hash_to_str_ar(msg);
break;
case RETRO_LANGUAGE_GREEK:
ret = msg_hash_to_str_el(msg);
break;
case RETRO_LANGUAGE_TURKISH:
ret = msg_hash_to_str_tr(msg);
break;
case RETRO_LANGUAGE_SLOVAK:
ret = msg_hash_to_str_sk(msg);
break;
case RETRO_LANGUAGE_PERSIAN:
ret = msg_hash_to_str_fa(msg);
break;
case RETRO_LANGUAGE_HEBREW:
ret = msg_hash_to_str_he(msg);
break;
case RETRO_LANGUAGE_ASTURIAN:
ret = msg_hash_to_str_ast(msg);
break;
case RETRO_LANGUAGE_FINNISH:
ret = msg_hash_to_str_fi(msg);
break;
case RETRO_LANGUAGE_INDONESIAN:
ret = msg_hash_to_str_id(msg);
break;
case RETRO_LANGUAGE_SWEDISH:
ret = msg_hash_to_str_sv(msg);
break;
case RETRO_LANGUAGE_UKRAINIAN:
ret = msg_hash_to_str_uk(msg);
break;
case RETRO_LANGUAGE_CZECH:
ret = msg_hash_to_str_cs(msg);
break;
case RETRO_LANGUAGE_CATALAN_VALENCIA:
ret = msg_hash_to_str_val(msg);
break;
case RETRO_LANGUAGE_CATALAN:
ret = msg_hash_to_str_ca(msg);
break;
case RETRO_LANGUAGE_BRITISH_ENGLISH:
ret = msg_hash_to_str_en(msg);
break;
case RETRO_LANGUAGE_HUNGARIAN:
ret = msg_hash_to_str_hu(msg);
break;
case RETRO_LANGUAGE_BELARUSIAN:
ret = msg_hash_to_str_be(msg);
break;
case RETRO_LANGUAGE_GALICIAN:
ret = msg_hash_to_str_gl(msg);
break;
case RETRO_LANGUAGE_NORWEGIAN:
ret = msg_hash_to_str_no(msg);
break;
default:
break;
}
#endif
if (ret && !string_is_equal(ret, "null"))
return ret;
return msg_hash_to_str_us(msg);
}
uint32_t msg_hash_calculate(const char *s)
{
return djb2_calculate(s);
}
#define MENU_VALUE_FILE_WEBM 0x7ca00b50U
#define MENU_VALUE_FILE_F4F 0x0b886be5U
#define MENU_VALUE_FILE_F4V 0x0b886bf5U
#define MENU_VALUE_FILE_OGM 0x0b8898c8U
#define MENU_VALUE_FILE_MKV 0x0b8890d3U
#define MENU_VALUE_FILE_AVI 0x0b885f25U
#define MENU_VALUE_FILE_M4A 0x0b8889a7U
#define MENU_VALUE_FILE_3GP 0x0b87998fU
#define MENU_VALUE_FILE_MP4 0x0b889136U
#define MENU_VALUE_FILE_MP3 0x0b889135U
#define MENU_VALUE_FILE_FLAC 0x7c96d67bU
#define MENU_VALUE_FILE_OGG 0x0b8898c2U
#define MENU_VALUE_FILE_MOD 0x0b889145U
#define MENU_VALUE_FILE_S3M 0x0b88a318U
#define MENU_VALUE_FILE_XM 0x00597a2aU
#define MENU_VALUE_FILE_FLV 0x0b88732dU
#define MENU_VALUE_FILE_WAV 0x0b88ba13U
#define MENU_VALUE_FILE_MOV 0x0b889157U
#define MENU_VALUE_FILE_WMV 0x0b88bb9fU
#define MENU_VALUE_FILE_3G2 0x0b879951U
#define MENU_VALUE_FILE_MPG 0x0b889169U
#define MENU_VALUE_FILE_MPEG 0x7c9abeaeU
#define MENU_VALUE_FILE_VOB 0x0b88b78cU
#define MENU_VALUE_FILE_ASF 0x0b885ebfU
#define MENU_VALUE_FILE_DIVX 0x7c95b3c0U
#define MENU_VALUE_FILE_M2P 0x0b888974U
#define MENU_VALUE_FILE_M2TS 0x7c99b8ebU
#define MENU_VALUE_FILE_PS 0x00597928U
#define MENU_VALUE_FILE_TS 0x005979acU
#define MENU_VALUE_FILE_MXF 0x0b889270U
#define MENU_VALUE_FILE_WMA 0x0b88bb8aU
#define MENU_VALUE_FILE_JPG 0x0b8884a6U
#define MENU_VALUE_FILE_JPEG 0x7c99198bU
#define MENU_VALUE_FILE_JPG_CAPS 0x0b87f846U
#define MENU_VALUE_FILE_JPEG_CAPS 0x7c87010bU
#define MENU_VALUE_FILE_PNG 0x0b889deaU
#define MENU_VALUE_FILE_PNG_CAPS 0x0b88118aU
#define MENU_VALUE_FILE_GONG 0x7c977150U
#define MENU_VALUE_FILE_GONG_CAPS 0x7c8558d0U
#define MENU_VALUE_FILE_TGA 0x0b88ae01U
#define MENU_VALUE_FILE_BMP 0x0b886244U
#define MENU_VALUE_MD5 0x0b888fabU
#define MENU_VALUE_SHA1 0x7c9de632U
#define MENU_VALUE_CRC 0x0b88671dU
#define MENU_VALUE_MORE 0x0b877cafU
#define MENU_VALUE_CFILE 0xac3ec4f9U
#define MENU_VALUE_ON 0x005974c2U
#define MENU_VALUE_OFF 0x0b880c40U
#define MENU_VALUE_COMP 0x6a166ba5U
#define MENU_VALUE_MUSIC 0xc4a73997U
#define MENU_VALUE_IMAGE 0xbab7ebf9U
#define MENU_VALUE_MOVIE 0xc43c4bf6U
#define MENU_VALUE_CORE 0x6a167f7fU
#define MENU_VALUE_FILE 0x6a496536U
#define MENU_VALUE_RDB 0x0b00f54eU
#define MENU_VALUE_DIR 0x0af95f55U
#define MENU_VALUE_GLSLP 0x0f840c87U
#define MENU_VALUE_CGP 0x0b8865bfU
#define MENU_VALUE_GLSL 0x7c976537U
#define MENU_VALUE_HLSL 0x7c97f198U
#define MENU_VALUE_HLSLP 0x0f962508U
#define MENU_VALUE_CG 0x0059776fU
#define MENU_VALUE_SLANG 0x105ce63aU
#define MENU_VALUE_SLANGP 0x1bf9adeaU
#define FILE_HASH_APK 0x0b885e61U
#define HASH_EXTENSION_7Z 0x005971d6U
#define HASH_EXTENSION_7Z_UPP 0x005971b6U
#define HASH_EXTENSION_ZIP 0x0b88c7d8U
#define HASH_EXTENSION_ZIP_UPP 0x0b883b78U
#define HASH_EXTENSION_CUE 0x0b886782U
#define HASH_EXTENSION_CUE_UPPERCASE 0x0b87db22U
#define HASH_EXTENSION_GDI 0x00b887659
#define HASH_EXTENSION_GDI_UPPERCASE 0x00b87e9f9
#define HASH_EXTENSION_ISO 0x0b8880d0U
#define HASH_EXTENSION_ISO_UPPERCASE 0x0b87f470U
#define HASH_EXTENSION_LUTRO 0x0fe37b7bU
#define HASH_EXTENSION_CHD 0x0b8865d4U
enum msg_file_type msg_hash_to_file_type(uint32_t hash)
{
switch (hash)
{
case MENU_VALUE_COMP:
case HASH_EXTENSION_7Z:
case HASH_EXTENSION_7Z_UPP:
case HASH_EXTENSION_ZIP:
case HASH_EXTENSION_ZIP_UPP:
case FILE_HASH_APK:
return FILE_TYPE_COMPRESSED;
case MENU_VALUE_CFILE:
return FILE_TYPE_IN_CARCHIVE;
case MENU_VALUE_MORE:
return FILE_TYPE_MORE;
case MENU_VALUE_CORE:
return FILE_TYPE_CORE;
case MENU_VALUE_RDB:
return FILE_TYPE_RDB;
case MENU_VALUE_FILE:
return FILE_TYPE_PLAIN;
case MENU_VALUE_DIR:
return FILE_TYPE_DIRECTORY;
case MENU_VALUE_MUSIC:
return FILE_TYPE_MUSIC;
case MENU_VALUE_IMAGE:
return FILE_TYPE_IMAGE;
case MENU_VALUE_MOVIE:
return FILE_TYPE_MOVIE;
case MENU_VALUE_ON:
return FILE_TYPE_BOOL_ON;
case MENU_VALUE_OFF:
return FILE_TYPE_BOOL_OFF;
case MENU_VALUE_GLSL:
return FILE_TYPE_SHADER_GLSL;
case MENU_VALUE_HLSL:
return FILE_TYPE_SHADER_HLSL;
case MENU_VALUE_CG:
return FILE_TYPE_SHADER_CG;
case MENU_VALUE_SLANG:
return FILE_TYPE_SHADER_SLANG;
case MENU_VALUE_GLSLP:
return FILE_TYPE_SHADER_PRESET_GLSLP;
case MENU_VALUE_HLSLP:
return FILE_TYPE_SHADER_PRESET_HLSLP;
case MENU_VALUE_CGP:
return FILE_TYPE_SHADER_PRESET_CGP;
case MENU_VALUE_SLANGP:
return FILE_TYPE_SHADER_PRESET_SLANGP;
case MENU_VALUE_CRC:
return FILE_TYPE_CRC;
case MENU_VALUE_SHA1:
return FILE_TYPE_SHA1;
case MENU_VALUE_MD5:
return FILE_TYPE_MD5;
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
case MENU_VALUE_FILE_OGM:
return FILE_TYPE_OGM;
case MENU_VALUE_FILE_MKV:
return FILE_TYPE_MKV;
case MENU_VALUE_FILE_AVI:
return FILE_TYPE_AVI;
case MENU_VALUE_FILE_MP4:
return FILE_TYPE_MP4;
case MENU_VALUE_FILE_FLV:
return FILE_TYPE_FLV;
case MENU_VALUE_FILE_WEBM:
return FILE_TYPE_WEBM;
case MENU_VALUE_FILE_3GP:
return FILE_TYPE_3GP;
case MENU_VALUE_FILE_F4F:
return FILE_TYPE_F4F;
case MENU_VALUE_FILE_F4V:
return FILE_TYPE_F4V;
case MENU_VALUE_FILE_MOV:
return FILE_TYPE_MOV;
case MENU_VALUE_FILE_WMV:
return FILE_TYPE_WMV;
case MENU_VALUE_FILE_M4A:
return FILE_TYPE_M4A;
case MENU_VALUE_FILE_3G2:
return FILE_TYPE_3G2;
case MENU_VALUE_FILE_MPG:
return FILE_TYPE_MPG;
case MENU_VALUE_FILE_MPEG:
return FILE_TYPE_MPEG;
case MENU_VALUE_FILE_VOB:
return FILE_TYPE_VOB;
case MENU_VALUE_FILE_ASF:
return FILE_TYPE_ASF;
case MENU_VALUE_FILE_DIVX:
return FILE_TYPE_DIVX;
case MENU_VALUE_FILE_M2P:
return FILE_TYPE_M2P;
case MENU_VALUE_FILE_M2TS:
return FILE_TYPE_M2TS;
case MENU_VALUE_FILE_PS:
return FILE_TYPE_PS;
case MENU_VALUE_FILE_TS:
return FILE_TYPE_TS;
case MENU_VALUE_FILE_MXF:
return FILE_TYPE_MXF;
case MENU_VALUE_FILE_WMA:
return FILE_TYPE_WMA;
#endif
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV) || defined(HAVE_AUDIOMIXER)
#if !defined(HAVE_AUDIOMIXER) || defined(HAVE_DR_MP3)
case MENU_VALUE_FILE_MP3:
return FILE_TYPE_MP3;
#endif
#if !defined(HAVE_AUDIOMIXER) || defined(HAVE_STB_VORBIS)
case MENU_VALUE_FILE_OGG:
return FILE_TYPE_OGG;
#endif
#if !defined(HAVE_AUDIOMIXER) || defined(HAVE_DR_FLAC)
case MENU_VALUE_FILE_FLAC:
return FILE_TYPE_FLAC;
#endif
#if !defined(HAVE_AUDIOMIXER) || defined(HAVE_RWAV)
case MENU_VALUE_FILE_WAV:
return FILE_TYPE_WAV;
#endif
#if !defined(HAVE_AUDIOMIXER) || defined(HAVE_IBXM)
case MENU_VALUE_FILE_MOD:
return FILE_TYPE_MOD;
case MENU_VALUE_FILE_S3M:
return FILE_TYPE_S3M;
case MENU_VALUE_FILE_XM:
return FILE_TYPE_XM;
#endif
#endif
#ifdef HAVE_IMAGEVIEWER
case MENU_VALUE_FILE_JPG:
case MENU_VALUE_FILE_JPG_CAPS:
case MENU_VALUE_FILE_JPEG:
case MENU_VALUE_FILE_JPEG_CAPS:
return FILE_TYPE_JPEG;
case MENU_VALUE_FILE_PNG:
case MENU_VALUE_FILE_PNG_CAPS:
return FILE_TYPE_PNG;
case MENU_VALUE_FILE_TGA:
return FILE_TYPE_TGA;
case MENU_VALUE_FILE_BMP:
return FILE_TYPE_BMP;
#endif
#ifdef HAVE_EASTEREGG
case MENU_VALUE_FILE_GONG:
case MENU_VALUE_FILE_GONG_CAPS:
return FILE_TYPE_GONG;
#endif
case HASH_EXTENSION_CUE:
case HASH_EXTENSION_CUE_UPPERCASE:
return FILE_TYPE_CUE;
case HASH_EXTENSION_GDI:
case HASH_EXTENSION_GDI_UPPERCASE:
return FILE_TYPE_GDI;
case HASH_EXTENSION_ISO:
case HASH_EXTENSION_ISO_UPPERCASE:
return FILE_TYPE_ISO;
case HASH_EXTENSION_LUTRO:
return FILE_TYPE_LUTRO;
case HASH_EXTENSION_CHD:
return FILE_TYPE_CHD;
default:
break;
}
return FILE_TYPE_NONE;
}
unsigned *msg_hash_get_uint(enum msg_hash_action type)
{
switch (type)
{
case MSG_HASH_USER_LANGUAGE:
return &uint_user_language;
case MSG_HASH_NONE:
break;
}
return NULL;
}
void msg_hash_set_uint(enum msg_hash_action type, unsigned val)
{
switch (type)
{
case MSG_HASH_USER_LANGUAGE:
uint_user_language = val;
break;
case MSG_HASH_NONE:
break;
}
}
const char *msg_hash_get_wideglyph_str(void)
{
#ifdef HAVE_LANGEXTRA
switch (uint_user_language)
{
case RETRO_LANGUAGE_CHINESE_SIMPLIFIED:
return "菜";
case RETRO_LANGUAGE_CHINESE_TRADITIONAL:
return "主";
case RETRO_LANGUAGE_JAPANESE:
return "漢";
case RETRO_LANGUAGE_KOREAN:
return "메";
default:
break;
}
#endif
return NULL;
}
|