Skip to content

Commit e88e93a

Browse files
committed
GameList: Add RegionToFlagFilename function to map regions to flag filenames
1 parent 18976ef commit e88e93a

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

pcsx2/GameList.cpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,44 @@ const char* GameList::RegionToString(Region region, bool translate)
150150
return name;
151151
}
152152

153+
const char* GameList::RegionToFlagFilename(Region region)
154+
{
155+
static constexpr std::array<const char*, static_cast<int>(Region::Count)> flag_names = {
156+
"br", // NTSC-B
157+
"cn", // NTSC-C
158+
"tw", // NTSC-HK
159+
"jp", // NTSC-J
160+
"kr", // NTSC-K
161+
"tw", // NTSC-T
162+
"us", // NTSC-U
163+
"us", // Other
164+
"au", // PAL-A
165+
"za", // PAL-AF
166+
"au", // PAL-AU
167+
"nl", // PAL-BE
168+
"de", // PAL-E
169+
"fr", // PAL-F
170+
"fi", // PAL-FI
171+
"de", // PAL-G
172+
"gr", // PAL-GR
173+
"it", // PAL-I
174+
"in", // PAL-IN
175+
"mx", // PAL-M
176+
"nl", // PAL-NL
177+
"no", // PAL-NO
178+
"pt", // PAL-P
179+
"pl", // PAL-PL
180+
"ru", // PAL-R
181+
"es", // PAL-S
182+
"se", // PAL-SC
183+
"se", // PAL-SW
184+
"se", // PAL-SWI
185+
"us", // PAL-UK
186+
};
187+
188+
return flag_names.at(static_cast<int>(region));
189+
}
190+
153191
const char* GameList::EntryCompatibilityRatingToString(CompatibilityRating rating, bool translate)
154192
{
155193
const char* name = "";

pcsx2/GameList.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ namespace GameList
106106

107107
const char* EntryTypeToString(EntryType type, bool translate);
108108
const char* RegionToString(Region region, bool translate);
109+
const char* RegionToFlagFilename(Region region);
109110
const char* EntryCompatibilityRatingToString(CompatibilityRating rating, bool translate);
110111

111112
/// Fills in boot parameters (iso or elf) based on the game list entry.

0 commit comments

Comments
 (0)