Skip to content
Permalink
Browse files

Merge pull request #8013 from JosJuice/titledatabase-japanese-gc

Show Japanese GC games in Japanese when using TitleDatabase
  • Loading branch information...
leoetlino committed May 1, 2019
2 parents ef88dd7 + fbe7892 commit bec85a09623e11493d58a0fcb5acb898604c0cd7
Showing with 19 additions and 9 deletions.
  1. +14 −7 Source/Core/Core/ConfigManager.cpp
  2. +2 −2 Source/Core/Core/ConfigManager.h
  3. +3 −0 Source/Core/UICommon/GameFile.cpp
@@ -646,7 +646,7 @@ void SConfig::LoadJitDebugSettings(IniFile& ini)

void SConfig::ResetRunningGameMetadata()
{
SetRunningGameMetadata("00000000", "", 0, 0);
SetRunningGameMetadata("00000000", "", 0, 0, DiscIO::Country::Unknown);
}

void SConfig::SetRunningGameMetadata(const DiscIO::Volume& volume,
@@ -655,13 +655,14 @@ void SConfig::SetRunningGameMetadata(const DiscIO::Volume& volume,
if (partition == volume.GetGamePartition())
{
SetRunningGameMetadata(volume.GetGameID(), volume.GetGameTDBID(),
volume.GetTitleID().value_or(0), volume.GetRevision().value_or(0));
volume.GetTitleID().value_or(0), volume.GetRevision().value_or(0),
volume.GetCountry());
}
else
{
SetRunningGameMetadata(volume.GetGameID(partition), volume.GetGameTDBID(),
volume.GetTitleID(partition).value_or(0),
volume.GetRevision(partition).value_or(0));
volume.GetRevision(partition).value_or(0), volume.GetCountry());
}
}

@@ -676,13 +677,16 @@ void SConfig::SetRunningGameMetadata(const IOS::ES::TMDReader& tmd)
if (!DVDInterface::UpdateRunningGameMetadata(tmd_title_id))
{
// If not launching a disc game, just read everything from the TMD.
SetRunningGameMetadata(tmd.GetGameID(), tmd.GetGameTDBID(), tmd_title_id,
tmd.GetTitleVersion());
const DiscIO::Country country =
DiscIO::CountryCodeToCountry(static_cast<u8>(tmd_title_id), DiscIO::Platform::WiiWAD,
tmd.GetRegion(), tmd.GetTitleVersion());
SetRunningGameMetadata(tmd.GetGameID(), tmd.GetGameTDBID(), tmd_title_id, tmd.GetTitleVersion(),
country);
}
}

void SConfig::SetRunningGameMetadata(const std::string& game_id, const std::string& gametdb_id,
u64 title_id, u16 revision)
u64 title_id, u16 revision, DiscIO::Country country)
{
const bool was_changed = m_game_id != game_id || m_gametdb_id != gametdb_id ||
m_title_id != title_id || m_revision != revision;
@@ -715,7 +719,10 @@ void SConfig::SetRunningGameMetadata(const std::string& game_id, const std::stri
}

const Core::TitleDatabase title_database;
m_title_description = title_database.Describe(m_gametdb_id, GetCurrentLanguage(bWii));
const DiscIO::Language language = !bWii && country == DiscIO::Country::Japan ?
DiscIO::Language::Japanese :
GetCurrentLanguage(bWii);
m_title_description = title_database.Describe(m_gametdb_id, language);
NOTICE_LOG(CORE, "Active title: %s", m_title_description.c_str());

Config::AddLayer(ConfigLoaders::GenerateGlobalGameConfigLoader(game_id, revision));
@@ -14,10 +14,10 @@
#include "Common/IniFile.h"
#include "Core/HW/EXI/EXI_Device.h"
#include "Core/HW/SI/SI_Device.h"
#include "Core/TitleDatabase.h"

namespace DiscIO
{
enum class Country;
enum class Language;
enum class Region;
struct Partition;
@@ -356,7 +356,7 @@ struct SConfig
void LoadJitDebugSettings(IniFile& ini);

void SetRunningGameMetadata(const std::string& game_id, const std::string& gametdb_id,
u64 title_id, u16 revision);
u64 title_id, u16 revision, DiscIO::Country country);

static SConfig* m_Instance;

@@ -60,6 +60,9 @@ static bool UseGameCovers()

DiscIO::Language GameFile::GetConfigLanguage() const
{
if (m_platform == DiscIO::Platform::GameCubeDisc && m_country == DiscIO::Country::Japan)
return DiscIO::Language::Japanese;

#ifdef ANDROID
// TODO: Make the Android app load the config at app start instead of emulation start
// so that we can access the user's preference here

0 comments on commit bec85a0

Please sign in to comment.
You can’t perform that action at this time.