From 06784d28694758f6532dd85f054b28120c88c2e3 Mon Sep 17 00:00:00 2001 From: LPFaint99 Date: Wed, 15 Dec 2010 23:18:08 +0000 Subject: [PATCH] sys menu now loads gamesettings from an ini file (as well as any other wad/nand title that does not have an ascii gamecode) fixes system menu loading the ini file from the last run game also check for all countries when setting bntsc for wad/nand titles git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6590 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/CoreParameter.cpp | 50 ++++++++++++++++++--- Source/Core/DolphinWX/Src/ISOProperties.cpp | 13 +++++- 2 files changed, 55 insertions(+), 8 deletions(-) diff --git a/Source/Core/Core/Src/CoreParameter.cpp b/Source/Core/Core/Src/CoreParameter.cpp index f1f9ae9372..7e0216d375 100644 --- a/Source/Core/Core/Src/CoreParameter.cpp +++ b/Source/Core/Core/Src/CoreParameter.cpp @@ -220,14 +220,30 @@ bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2) return false; //do not boot } - u64 TitleID = ContentLoader.GetTitleID(); - char* pTitleID = (char*)&TitleID; - - // NTSC or PAL - if (pTitleID[0] == 'E' || pTitleID[0] == 'J') + switch (ContentLoader.GetCountry()) + { + case DiscIO::IVolume::COUNTRY_USA: bNTSC = true; - else + break; + + case DiscIO::IVolume::COUNTRY_TAIWAN: + case DiscIO::IVolume::COUNTRY_KOREA: + // TODO: Should these have their own Region Dir? + case DiscIO::IVolume::COUNTRY_JAPAN: + bNTSC = true; + break; + + case DiscIO::IVolume::COUNTRY_EUROPE: + case DiscIO::IVolume::COUNTRY_FRANCE: + case DiscIO::IVolume::COUNTRY_ITALY: + case DiscIO::IVolume::COUNTRY_RUSSIA: bNTSC = false; + break; + + default: + bNTSC = false; + break; + } bWii = true; Region = EUR_DIR; @@ -237,9 +253,29 @@ bool SCoreStartupParameter::AutoSetup(EBootBS2 _BootBS2) { m_strName = pVolume->GetName(); m_strUniqueID = pVolume->GetUniqueID(); + delete pVolume; + } + else + { // null pVolume means that we are loading from nand folder (Most Likely Wii Menu) + // if this is the second boot we would be using the Name and id of the last title + m_strName.clear(); + m_strUniqueID.clear(); + } + + // Use the TitleIDhex for name and/or unique ID if launching from nand folder + // or if it is not ascii characters (specifically sysmenu could potentially apply to other things) + char titleidstr[17]; + snprintf(titleidstr, 17, "%016llx", ContentLoader.GetTitleID()); + + if (!m_strName.length()) + { + m_strName = titleidstr; + } + if (!m_strUniqueID.length()) + { + m_strUniqueID = titleidstr; } - delete pVolume; } else { diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp index c1d3b1437b..30c4d3ad8a 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.cpp +++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp @@ -110,7 +110,18 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW CreateGUIControls(DiscIO::IsVolumeWadFile(OpenISO)); - GameIniFile = std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + (OpenISO->GetUniqueID()) + ".ini"; + std::string _iniFilename = OpenISO->GetUniqueID(); + if (!_iniFilename.length()) + { + char tmp[17]; + u8 _tTitleID[8]; + if(OpenISO->GetTitleID(_tTitleID)) + { + snprintf(tmp, 17, "%016llx", Common::swap64(_tTitleID)); + _iniFilename = tmp; + } + } + GameIniFile = std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + _iniFilename + ".ini"; if (GameIni.Load(GameIniFile.c_str())) LoadGameConfig(); else