This commit is contained in:
Nekotekina 2015-04-20 04:54:19 +03:00
parent 935302b620
commit 8c1aa3ee15
3 changed files with 34 additions and 28 deletions

View file

@ -155,7 +155,7 @@ bool rMkdir(const std::string& dir)
if (mkdir(dir.c_str(), 0777)) if (mkdir(dir.c_str(), 0777))
#endif #endif
{ {
LOG_ERROR(GENERAL, "Error creating directory '%s': 0x%llx", dir, GET_API_ERROR); LOG_WARNING(GENERAL, "Error creating directory '%s': 0x%llx", dir, GET_API_ERROR);
return false; return false;
} }
@ -197,7 +197,7 @@ bool rRmdir(const std::string& dir)
if (rmdir(dir.c_str())) if (rmdir(dir.c_str()))
#endif #endif
{ {
LOG_ERROR(GENERAL, "Error deleting directory '%s': 0x%llx", dir, GET_API_ERROR); LOG_WARNING(GENERAL, "Error deleting directory '%s': 0x%llx", dir, GET_API_ERROR);
return false; return false;
} }
@ -213,7 +213,7 @@ bool rRename(const std::string& from, const std::string& to)
if (rename(from.c_str(), to.c_str())) if (rename(from.c_str(), to.c_str()))
#endif #endif
{ {
LOG_ERROR(GENERAL, "Error renaming '%s' to '%s': 0x%llx", from, to, GET_API_ERROR); LOG_WARNING(GENERAL, "Error renaming '%s' to '%s': 0x%llx", from, to, GET_API_ERROR);
return false; return false;
} }
@ -264,7 +264,7 @@ bool rCopy(const std::string& from, const std::string& to, bool overwrite)
if (OSCopyFile(from.c_str(), to.c_str(), overwrite)) if (OSCopyFile(from.c_str(), to.c_str(), overwrite))
#endif #endif
{ {
LOG_ERROR(GENERAL, "Error copying '%s' to '%s': 0x%llx", from, to, GET_API_ERROR); LOG_WARNING(GENERAL, "Error copying '%s' to '%s': 0x%llx", from, to, GET_API_ERROR);
return false; return false;
} }
@ -289,7 +289,7 @@ bool rRemoveFile(const std::string& file)
if (unlink(file.c_str())) if (unlink(file.c_str()))
#endif #endif
{ {
LOG_ERROR(GENERAL, "Error deleting file '%s': 0x%llx", file, GET_API_ERROR); LOG_WARNING(GENERAL, "Error deleting file '%s': 0x%llx", file, GET_API_ERROR);
return false; return false;
} }
@ -304,7 +304,7 @@ bool rTruncate(const std::string& file, uint64_t length)
if (truncate64(file.c_str(), length)) if (truncate64(file.c_str(), length))
#endif #endif
{ {
LOG_ERROR(GENERAL, "Error resizing file '%s' to 0x%llx: 0x%llx", file, length, GET_API_ERROR); LOG_WARNING(GENERAL, "Error resizing file '%s' to 0x%llx: 0x%llx", file, length, GET_API_ERROR);
return false; return false;
} }
@ -373,7 +373,7 @@ bool rfile_t::open(const std::string& filename, u32 mode)
case o_read | o_write: access |= GENERIC_READ | GENERIC_WRITE; break; case o_read | o_write: access |= GENERIC_READ | GENERIC_WRITE; break;
default: default:
{ {
LOG_ERROR(GENERAL, "rfile_t::open(): neither o_read nor o_write specified"); LOG_ERROR(GENERAL, "rfile_t::open('%s') failed: neither o_read nor o_write specified (0x%x)", filename, mode);
return false; return false;
} }
} }
@ -390,11 +390,11 @@ bool rfile_t::open(const std::string& filename, u32 mode)
if (!disp || (mode & ~(o_read | o_write | o_create | o_trunc | o_excl))) if (!disp || (mode & ~(o_read | o_write | o_create | o_trunc | o_excl)))
{ {
LOG_ERROR(GENERAL, "rfile_t::open(): unknown mode specified (0x%x)", mode); LOG_ERROR(GENERAL, "rfile_t::open('%s') failed: unknown mode specified (0x%x)", filename, mode);
return false; return false;
} }
fd = CreateFileW(ConvertUTF8ToWChar(filename).get(), access, FILE_SHARE_READ, NULL, disp, FILE_ATTRIBUTE_NORMAL, NULL); if ((fd = CreateFileW(ConvertUTF8ToWChar(filename).get(), access, FILE_SHARE_READ, NULL, disp, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE)
#else #else
int flags = 0; int flags = 0;
@ -405,7 +405,7 @@ bool rfile_t::open(const std::string& filename, u32 mode)
case o_read | o_write: flags |= O_RDWR; break; case o_read | o_write: flags |= O_RDWR; break;
default: default:
{ {
LOG_ERROR(GENERAL, "rfile_t::open(): neither o_read nor o_write specified"); LOG_ERROR(GENERAL, "rfile_t::open('%s') failed: neither o_read nor o_write specified (0x%x)", filename, mode);
return false; return false;
} }
} }
@ -416,14 +416,18 @@ bool rfile_t::open(const std::string& filename, u32 mode)
if (((mode & o_excl) && (!(mode & o_create) || (mode & o_trunc))) || (mode & ~(o_read | o_write | o_create | o_trunc | o_excl))) if (((mode & o_excl) && (!(mode & o_create) || (mode & o_trunc))) || (mode & ~(o_read | o_write | o_create | o_trunc | o_excl)))
{ {
LOG_ERROR(GENERAL, "rfile_t::open(): unknown mode specified (0x%x)", mode); LOG_ERROR(GENERAL, "rfile_t::open('%s') failed: unknown mode specified (0x%x)", filename, mode);
return false; return false;
} }
fd = ::open(filename.c_str(), flags, 0666); if ((fd = ::open(filename.c_str(), flags, 0666)) == -1)
#endif #endif
{
LOG_WARNING(GENERAL, "rfile_t::open('%s', 0x%x) failed: error 0x%llx", filename, mode, GET_API_ERROR);
return false;
}
return is_opened(); return true;
} }
bool rfile_t::is_opened() const bool rfile_t::is_opened() const

View file

@ -351,13 +351,11 @@ void Emulator::Stop()
finalize_psv_modules(); finalize_psv_modules();
clear_all_psv_objects(); clear_all_psv_objects();
for (auto& v : g_armv7_dump) for (auto& v : decltype(g_armv7_dump)(std::move(g_armv7_dump)))
{ {
LOG_NOTICE(ARMv7, v.second); LOG_NOTICE(ARMv7, v.second);
} }
g_armv7_dump.clear();
m_rsx_callback = 0; m_rsx_callback = 0;
// TODO: check finalization order // TODO: check finalization order

View file

@ -130,23 +130,27 @@ void GameViewer::LoadPSF()
m_game_data.clear(); m_game_data.clear();
for(uint i=0; i<m_games.size(); ++i) for(uint i=0; i<m_games.size(); ++i)
{ {
const std::string sfb = m_path + m_games[i] + "/PS3_DISC.SFB";
const std::string sfo = m_path + m_games[i] + (Emu.GetVFS().ExistsFile(sfb) ? "/PS3_GAME/PARAM.SFO" : "/PARAM.SFO");
if (!Emu.GetVFS().ExistsFile(sfo))
{
continue;
}
vfsFile f; vfsFile f;
std::string sfo;
std::string sfb;
sfb = m_path + m_games[i] + "/PS3_DISC.SFB";
if (!f.Open(sfb))
sfo = m_path + m_games[i] + "/PARAM.SFO";
else
sfo = m_path + m_games[i] + "/PS3_GAME/PARAM.SFO";
if (!f.Open(sfo)) if (!f.Open(sfo))
{
continue; continue;
}
const PSFLoader psf(f); const PSFLoader psf(f);
if (!psf) if (!psf)
{
continue; continue;
}
// get local path from VFS... // get local path from VFS...
std::string local_path; std::string local_path;