Fixed the save file path issue of r4613

Anyone encounters significant FPS drop (comparing to r4611 or earlier) please report 

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4614 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
ayuanx 2009-11-26 17:50:14 +00:00
parent 7a6241da81
commit fddab016fa
4 changed files with 21 additions and 20 deletions

View File

@ -89,7 +89,6 @@ void Init()
g_DeviceMap[i] = new CWII_IPC_HLE_Device_stm_immediate(i, std::string("/dev/stm/immediate")); i++;
g_DeviceMap[i] = new CWII_IPC_HLE_Device_stm_eventhook(i, std::string("/dev/stm/eventhook")); i++;
g_DeviceMap[i] = new CWII_IPC_HLE_Device_fs(i, std::string("/dev/fs")); i++;
// Warning: "/dev/es" must be created after "/dev/fs", not before
g_DeviceMap[i] = new CWII_IPC_HLE_Device_es(i, std::string("/dev/es")); i++;
g_DeviceMap[i] = new CWII_IPC_HLE_Device_di(i, std::string("/dev/di")); i++;
g_DeviceMap[i] = new CWII_IPC_HLE_Device_net_kd_request(i, std::string("/dev/net/kd/request")); i++;
@ -140,7 +139,7 @@ void SetDefaultContentFile(const std::string& _rFilename)
{
CWII_IPC_HLE_Device_es* pDevice = (CWII_IPC_HLE_Device_es*)AccessDeviceByID(GetDeviceIDByName(std::string("/dev/es")));
if (pDevice)
pDevice->Load(_rFilename);
pDevice->LoadWAD(_rFilename);
}
u32 GetDeviceIDByName(const std::string& _rDeviceName)

View File

@ -40,14 +40,7 @@ CWII_IPC_HLE_Device_di::CWII_IPC_HLE_Device_di(u32 _DeviceID, const std::string&
, m_pFileSystem(NULL)
, m_ErrorStatus(0)
, m_CoverStatus(DI_COVER_REG_NO_DISC)
{
if (VolumeHandler::IsValid())
{
m_pFileSystem = DiscIO::CreateFileSystem(VolumeHandler::GetVolume());
m_CoverStatus |= DI_COVER_REG_INITIALIZED;
m_CoverStatus &= ~DI_COVER_REG_NO_DISC;
}
}
{}
CWII_IPC_HLE_Device_di::~CWII_IPC_HLE_Device_di()
{
@ -60,7 +53,13 @@ CWII_IPC_HLE_Device_di::~CWII_IPC_HLE_Device_di()
bool CWII_IPC_HLE_Device_di::Open(u32 _CommandAddress, u32 _Mode)
{
Memory::Write_U32(GetDeviceID(), _CommandAddress + 4);
if (VolumeHandler::IsValid())
{
m_pFileSystem = DiscIO::CreateFileSystem(VolumeHandler::GetVolume());
m_CoverStatus |= DI_COVER_REG_INITIALIZED;
m_CoverStatus &= ~DI_COVER_REG_NO_DISC;
}
Memory::Write_U32(GetDeviceID(), _CommandAddress + 4);
m_Active = true;
return true;
}

View File

@ -60,8 +60,8 @@ CWII_IPC_HLE_Device_es::CWII_IPC_HLE_Device_es(u32 _DeviceID, const std::string&
, m_pContentLoader(NULL)
, m_TitleID(-1)
, AccessIdentID(0x6000000)
{
}
, m_ContentFile()
{}
CWII_IPC_HLE_Device_es::~CWII_IPC_HLE_Device_es()
{
@ -69,9 +69,14 @@ CWII_IPC_HLE_Device_es::~CWII_IPC_HLE_Device_es()
m_NANDContent.clear();
}
void CWII_IPC_HLE_Device_es::Load(const std::string& _rDefaultContentFile)
void CWII_IPC_HLE_Device_es::LoadWAD(const std::string& _rContentFile)
{
m_pContentLoader = &DiscIO::CNANDContentManager::Access().GetNANDLoader(_rDefaultContentFile);
m_ContentFile = _rContentFile;
}
bool CWII_IPC_HLE_Device_es::Open(u32 _CommandAddress, u32 _Mode)
{
m_pContentLoader = &DiscIO::CNANDContentManager::Access().GetNANDLoader(m_ContentFile);
// check for cd ...
if (m_pContentLoader->IsValid())
@ -102,11 +107,8 @@ void CWII_IPC_HLE_Device_es::Load(const std::string& _rDefaultContentFile)
//FindValidTitleIDs();
INFO_LOG(WII_IPC_ES, "Set default title to %08x/%08x", (u32)(m_TitleID>>32), (u32)m_TitleID);
}
bool CWII_IPC_HLE_Device_es::Open(u32 _CommandAddress, u32 _Mode)
{
Memory::Write_U32(GetDeviceID(), _CommandAddress+4);
Memory::Write_U32(GetDeviceID(), _CommandAddress+4);
m_Active = true;
return true;
}

View File

@ -30,7 +30,7 @@ public:
virtual ~CWII_IPC_HLE_Device_es();
void Load(const std::string& _rDefaultContentFile);
void LoadWAD(const std::string& _rContentFile);
virtual bool Open(u32 _CommandAddress, u32 _Mode);
@ -132,6 +132,7 @@ private:
std::vector<u64> m_TitleIDs;
u64 m_TitleID;
u32 AccessIdentID;
std::string m_ContentFile;
u64 GetCurrentTitleID() const;