Debian Codegraph @

Source/Core/DiscIO/Enums.h

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