Added Open Wii save folder menu item to GameListCtrl, fixed a few remaining path and casting problems

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3135 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
sl1nk3.s
2009-05-02 18:06:42 +00:00
parent e89af68f4d
commit 168362288c
7 changed files with 56 additions and 12 deletions

View File

@ -206,3 +206,29 @@ const std::string& GameListItem::GetName(int index) const
return m_Name[0];
}
const std::string GameListItem::GetWiiFSPath() const
{
DiscIO::IVolume *Iso = DiscIO::CreateVolumeFromFilename(m_FileName);
if (Iso != NULL)
{
if (DiscIO::IsVolumeWiiDisc(Iso))
{
char Path[250];
u64 Title;
Iso->RAWRead((u64)0x0F8001DC, 8, (u8*)&Title);
Title = Common::swap64(Title);
sprintf(Path, FULL_WII_USER_DIR "title/%08x/%08x/data/", (u32)(Title>>32), (u32)Title);
if (!File::Exists(Path))
File::CreateFullPath(Path);
return std::string(wxGetCwd().mb_str()) + std::string(Path).substr(strlen(ROOT_DIR));
}
}
return "NULL";
}