Enums.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // Copyright 2016 Dolphin Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include <optional>
  5. #include <string>
  6. #include "Common/CommonTypes.h"
  7. namespace DiscIO
  8. {
  9. // Increment CACHE_REVISION (GameFileCache.cpp) if these enums are modified
  10. enum class Platform
  11. {
  12. GameCubeDisc = 0,
  13. WiiDisc,
  14. WiiWAD,
  15. ELFOrDOL,
  16. NumberOfPlatforms
  17. };
  18. enum class Country
  19. {
  20. Europe = 0,
  21. Japan,
  22. USA,
  23. Australia,
  24. France,
  25. Germany,
  26. Italy,
  27. Korea,
  28. Netherlands,
  29. Russia,
  30. Spain,
  31. Taiwan,
  32. World,
  33. Unknown,
  34. NumberOfCountries
  35. };
  36. // This numbering matches Nintendo's GameCube/Wii region numbering.
  37. enum class Region
  38. {
  39. NTSC_J = 0, // Japan and Taiwan (and South Korea for GameCube only)
  40. NTSC_U = 1, // Mainly North America
  41. PAL = 2, // Mainly Europe and Oceania
  42. Unknown = 3, // Nintendo uses this to mean region free, but we also use it for unknown regions
  43. NTSC_K = 4 // South Korea (Wii only)
  44. };
  45. // Languages 0 - 9 match Nintendo's Wii language numbering.
  46. // Languages 1 - 6 match Nintendo's PAL GameCube languages 0 - 5.
  47. // NTSC GameCubes only support one language and thus don't number languages.
  48. enum class Language
  49. {
  50. Japanese = 0,
  51. English = 1,
  52. German = 2,
  53. French = 3,
  54. Spanish = 4,
  55. Italian = 5,
  56. Dutch = 6,
  57. SimplifiedChinese = 7, // Not selectable on any unmodded retail Wii
  58. TraditionalChinese = 8, // Not selectable on any unmodded retail Wii
  59. Korean = 9,
  60. Unknown
  61. };
  62. std::string GetName(Country country, bool translate);
  63. std::string GetName(Language language, bool translate);
  64. std::string GetName(Region region, bool translate);
  65. bool IsDisc(Platform volume_type);
  66. bool IsWii(Platform volume_type);
  67. bool IsNTSC(Region region);
  68. int ToGameCubeLanguage(Language language);
  69. Language FromGameCubeLanguage(int language);
  70. Country TypicalCountryForRegion(Region region);
  71. Region SysConfCountryToRegion(u8 country_code);
  72. // Avoid using this function if you can. Country codes aren't always reliable region indicators.
  73. Region CountryCodeToRegion(u8 country_code, Platform platform,
  74. Region expected_region = Region::Unknown,
  75. std::optional<u16> revision = {});
  76. Country CountryCodeToCountry(u8 country_code, Platform platform, Region region = Region::Unknown,
  77. std::optional<u16> revision = {});
  78. Region GetSysMenuRegion(u16 title_version);
  79. std::string GetSysMenuVersionString(u16 title_version, bool is_vwii);
  80. const std::string& GetCompanyFromID(const std::string& company_id);
  81. } // namespace DiscIO