mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 07:21:25 +12:00
vfsDir usage fixed
This commit is contained in:
parent
31a41b795e
commit
9cfdce91a1
6 changed files with 32 additions and 32 deletions
|
@ -129,7 +129,7 @@ __noinline s32 savedata_op(
|
||||||
|
|
||||||
for (const auto entry : vfsDir(base_dir))
|
for (const auto entry : vfsDir(base_dir))
|
||||||
{
|
{
|
||||||
if (!(entry->flags & DirEntry_TypeDir))
|
if (entry->flags & DirEntry_TypeFile)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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(): 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(): Using k_licensee 0x%s", k_licensee_str.c_str());
|
||||||
|
|
||||||
// Set the necessary file paths.
|
// Set the necessary file paths.
|
||||||
std::string drm_file_name = fmt::AfterLast(drm_path.get_ptr(), '/');
|
std::string drm_file_name = fmt::AfterLast(drm_path.get_ptr(), '/');
|
||||||
|
@ -116,12 +116,7 @@ int npDrmIsAvailable(u32 k_licensee_addr, vm::ptr<const char> drm_path)
|
||||||
std::string rap_path("/dev_hdd0/home/" + pf_str + "/exdata/");
|
std::string rap_path("/dev_hdd0/home/" + pf_str + "/exdata/");
|
||||||
|
|
||||||
// Search dev_usb000 for a compatible RAP file.
|
// Search dev_usb000 for a compatible RAP file.
|
||||||
vfsDir raps_dir(rap_path);
|
for (const auto entry : vfsDir(rap_path))
|
||||||
if (!raps_dir.IsOpened())
|
|
||||||
sceNp.Warning("npDrmIsAvailable: Can't find RAP file for DRM!");
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (const DirEntryInfo *entry : raps_dir)
|
|
||||||
{
|
{
|
||||||
if (entry->name.find(titleID) != std::string::npos)
|
if (entry->name.find(titleID) != std::string::npos)
|
||||||
{
|
{
|
||||||
|
@ -129,6 +124,10 @@ int npDrmIsAvailable(u32 k_licensee_addr, vm::ptr<const char> drm_path)
|
||||||
break;
|
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.
|
// Decrypt this EDAT using the supplied k_licensee and matching RAP file.
|
||||||
|
|
|
@ -91,24 +91,29 @@ int sceNpTrophyInit(u32 pool_addr, u32 poolSize, u32 containerId, u64 options)
|
||||||
return CELL_OK;
|
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)",
|
sceNpTrophy.Warning("sceNpTrophyCreateContext(context=*0x%x, commID=*0x%x, commSign=*0x%x, options=0x%llx)", context, commID, commSign, options);
|
||||||
context.addr(), commID.addr(), commSign.addr(), options);
|
|
||||||
|
|
||||||
if (!sceNpTrophyInstance.m_bInitialized)
|
if (!sceNpTrophyInstance.m_bInitialized)
|
||||||
|
{
|
||||||
return SCE_NP_TROPHY_ERROR_NOT_INITIALIZED;
|
return SCE_NP_TROPHY_ERROR_NOT_INITIALIZED;
|
||||||
if (options & (~(u64)1))
|
}
|
||||||
|
|
||||||
|
if (options & ~1)
|
||||||
|
{
|
||||||
return SCE_NP_TROPHY_ERROR_NOT_SUPPORTED;
|
return SCE_NP_TROPHY_ERROR_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
// TODO: There are other possible errors
|
// TODO: There are other possible errors
|
||||||
|
|
||||||
// TODO: Is the TROPHY.TRP file necessarily located in this path?
|
// TODO: Is the TROPHY.TRP file necessarily located in this path?
|
||||||
vfsDir dir("/app_home/../TROPDIR/");
|
if (!Emu.GetVFS().ExistsDir("/app_home/../TROPDIR/"))
|
||||||
if(!dir.IsOpened())
|
{
|
||||||
return SCE_NP_TROPHY_ERROR_CONF_DOES_NOT_EXIST;
|
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
|
// 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)
|
if (entry->flags & DirEntry_TypeDir)
|
||||||
{
|
{
|
||||||
|
|
|
@ -106,23 +106,15 @@ void GameViewer::OnColClick(wxListEvent& event)
|
||||||
|
|
||||||
void GameViewer::LoadGames()
|
void GameViewer::LoadGames()
|
||||||
{
|
{
|
||||||
vfsDir dir(m_path);
|
|
||||||
LOG_NOTICE(HLE, "path: %s", m_path.c_str());
|
|
||||||
if(!dir.IsOpened()) return;
|
|
||||||
|
|
||||||
m_games.clear();
|
m_games.clear();
|
||||||
|
|
||||||
for(const DirEntryInfo* info : dir)
|
for (const auto info : vfsDir(m_path))
|
||||||
{
|
{
|
||||||
if(info->flags & DirEntry_TypeDir)
|
if(info->flags & DirEntry_TypeDir)
|
||||||
{
|
{
|
||||||
m_games.push_back(info->name);
|
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()
|
void GameViewer::LoadPSF()
|
||||||
|
|
|
@ -44,10 +44,9 @@ void LLEModulesManagerFrame::Refresh()
|
||||||
|
|
||||||
Emu.GetVFS().Init(path);
|
Emu.GetVFS().Init(path);
|
||||||
|
|
||||||
vfsDir dir(path);
|
|
||||||
|
|
||||||
loader::handlers::elf64 sprx_loader;
|
loader::handlers::elf64 sprx_loader;
|
||||||
for (const auto info : dir)
|
|
||||||
|
for (const auto info : vfsDir(path))
|
||||||
{
|
{
|
||||||
if (info->flags & DirEntry_TypeFile)
|
if (info->flags & DirEntry_TypeFile)
|
||||||
{
|
{
|
||||||
|
|
|
@ -327,6 +327,11 @@ namespace loader
|
||||||
|
|
||||||
for (const auto module : lle_dir)
|
for (const auto module : lle_dir)
|
||||||
{
|
{
|
||||||
|
if (module->flags & DirEntry_TypeDir)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
elf64 sprx_handler;
|
elf64 sprx_handler;
|
||||||
|
|
||||||
vfsFile fsprx(lle_dir.GetPath() + "/" + module->name);
|
vfsFile fsprx(lle_dir.GetPath() + "/" + module->name);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue