vfsDir usage fixed

This commit is contained in:
Nekotekina 2015-04-26 00:26:54 +03:00
parent 31a41b795e
commit 9cfdce91a1
6 changed files with 32 additions and 32 deletions

View File

@ -129,7 +129,7 @@ __noinline s32 savedata_op(
for (const auto entry : vfsDir(base_dir))
{
if (!(entry->flags & DirEntry_TypeDir))
if (entry->flags & DirEntry_TypeFile)
{
continue;
}

View File

@ -100,8 +100,8 @@ int npDrmIsAvailable(u32 k_licensee_addr, vm::ptr<const char> drm_path)
}
}
sceNp.Warning("npDrmIsAvailable: Found DRM license file at %s", drm_path.get_ptr());
sceNp.Warning("npDrmIsAvailable: Using k_licensee 0x%s", k_licensee_str.c_str());
sceNp.Warning("npDrmIsAvailable(): Found DRM license file at %s", drm_path.get_ptr());
sceNp.Warning("npDrmIsAvailable(): Using k_licensee 0x%s", k_licensee_str.c_str());
// Set the necessary file paths.
std::string drm_file_name = fmt::AfterLast(drm_path.get_ptr(), '/');
@ -116,21 +116,20 @@ int npDrmIsAvailable(u32 k_licensee_addr, vm::ptr<const char> drm_path)
std::string rap_path("/dev_hdd0/home/" + pf_str + "/exdata/");
// Search dev_usb000 for a compatible RAP file.
vfsDir raps_dir(rap_path);
if (!raps_dir.IsOpened())
sceNp.Warning("npDrmIsAvailable: Can't find RAP file for DRM!");
else
for (const auto entry : vfsDir(rap_path))
{
for (const DirEntryInfo *entry : raps_dir)
if (entry->name.find(titleID) != std::string::npos)
{
if (entry->name.find(titleID) != std::string::npos)
{
rap_path += entry->name;
break;
}
rap_path += entry->name;
break;
}
}
if (rap_path.back() == '/')
{
sceNp.Warning("npDrmIsAvailable(): Can't find RAP file for '%s' (titleID='%s')", drm_path.get_ptr(), titleID);
}
// Decrypt this EDAT using the supplied k_licensee and matching RAP file.
std::string enc_drm_path_local, dec_drm_path_local, rap_path_local;
Emu.GetVFS().GetDevice(enc_drm_path, enc_drm_path_local);

View File

@ -91,24 +91,29 @@ int sceNpTrophyInit(u32 pool_addr, u32 poolSize, u32 containerId, u64 options)
return CELL_OK;
}
int sceNpTrophyCreateContext(vm::ptr<u32> context, vm::ptr<SceNpCommunicationId> commID, vm::ptr<SceNpCommunicationSignature> commSign, u64 options)
int sceNpTrophyCreateContext(vm::ptr<u32> context, vm::ptr<const SceNpCommunicationId> commID, vm::ptr<const SceNpCommunicationSignature> commSign, u64 options)
{
sceNpTrophy.Warning("sceNpTrophyCreateContext(context_addr=0x%x, commID_addr=0x%x, commSign_addr=0x%x, options=0x%llx)",
context.addr(), commID.addr(), commSign.addr(), options);
sceNpTrophy.Warning("sceNpTrophyCreateContext(context=*0x%x, commID=*0x%x, commSign=*0x%x, options=0x%llx)", context, commID, commSign, options);
if (!sceNpTrophyInstance.m_bInitialized)
{
return SCE_NP_TROPHY_ERROR_NOT_INITIALIZED;
if (options & (~(u64)1))
}
if (options & ~1)
{
return SCE_NP_TROPHY_ERROR_NOT_SUPPORTED;
}
// TODO: There are other possible errors
// TODO: Is the TROPHY.TRP file necessarily located in this path?
vfsDir dir("/app_home/../TROPDIR/");
if(!dir.IsOpened())
if (!Emu.GetVFS().ExistsDir("/app_home/../TROPDIR/"))
{
return SCE_NP_TROPHY_ERROR_CONF_DOES_NOT_EXIST;
}
// TODO: Following method will retrieve the TROPHY.TRP of the first folder that contains such file
for(const DirEntryInfo* entry = dir.Read(); entry; entry = dir.Read())
for (const auto entry : vfsDir("/app_home/../TROPDIR/"))
{
if (entry->flags & DirEntry_TypeDir)
{

View File

@ -106,23 +106,15 @@ void GameViewer::OnColClick(wxListEvent& event)
void GameViewer::LoadGames()
{
vfsDir dir(m_path);
LOG_NOTICE(HLE, "path: %s", m_path.c_str());
if(!dir.IsOpened()) return;
m_games.clear();
for(const DirEntryInfo* info : dir)
for (const auto info : vfsDir(m_path))
{
if(info->flags & DirEntry_TypeDir)
{
m_games.push_back(info->name);
}
}
dir.Close();
//ConLog.Write("path: %s", m_path.wx_str());
//ConLog.Write("folders count: %d", m_games.GetCount());
}
void GameViewer::LoadPSF()

View File

@ -44,10 +44,9 @@ void LLEModulesManagerFrame::Refresh()
Emu.GetVFS().Init(path);
vfsDir dir(path);
loader::handlers::elf64 sprx_loader;
for (const auto info : dir)
for (const auto info : vfsDir(path))
{
if (info->flags & DirEntry_TypeFile)
{

View File

@ -327,6 +327,11 @@ namespace loader
for (const auto module : lle_dir)
{
if (module->flags & DirEntry_TypeDir)
{
continue;
}
elf64 sprx_handler;
vfsFile fsprx(lle_dir.GetPath() + "/" + module->name);