diff options
| author | JosJuice <josjuice@gmail.com> | 2016-12-23 18:41:21 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2017-01-02 20:57:11 +0100 |
| commit | 66ea9f5cc18ca6beb87ddd7f7a291d96669ad653 (patch) | |
| tree | 011a81833e2b2b5452b390ba4f58181ab77e8d66 /Source/Core/DiscIO/Volume.h | |
| parent | 6aef0630f74e61d6847fc1f1186056df8bd42651 (diff) | |
DiscIO: Add GetRegion function and Region enum
Instead of needing different switch cases for
converting countries to regions in multiple places,
we now only need a single country-to-region switch case
(in DiscIO/Enums.cpp), and we get a nice Region type.
Diffstat (limited to 'Source/Core/DiscIO/Volume.h')
| -rw-r--r-- | Source/Core/DiscIO/Volume.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Source/Core/DiscIO/Volume.h b/Source/Core/DiscIO/Volume.h index 44af039cba..6f4a6defe4 100644 --- a/Source/Core/DiscIO/Volume.h +++ b/Source/Core/DiscIO/Volume.h @@ -55,6 +55,7 @@ public: virtual bool SupportsIntegrityCheck() const { return false; } virtual bool CheckIntegrity() const { return false; } virtual bool ChangePartition(u64 offset) { return false; } + virtual Region GetRegion() const = 0; virtual Country GetCountry() const = 0; virtual BlobType GetBlobType() const = 0; // Size of virtual disc (not always accurate) @@ -71,12 +72,7 @@ protected: // strnlen to trim NULLs std::string string(data, strnlen(data, sizeof(data))); - // There doesn't seem to be any GC discs with the country set to Taiwan... - // But maybe they would use Shift_JIS if they existed? Not sure - bool use_shift_jis = - (Country::COUNTRY_JAPAN == GetCountry() || Country::COUNTRY_TAIWAN == GetCountry()); - - if (use_shift_jis) + if (GetRegion() == Region::NTSC_J) return SHIFTJISToUTF8(string); else return CP1252ToUTF8(string); |
