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
This commit is contained in:
LPFaint99 2010-12-15 23:18:08 +00:00
parent a90d0e8985
commit 06784d2869
2 changed files with 55 additions and 8 deletions

View File

@ -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
{

View File

@ -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