Skip to content

Commit

Permalink
Merge pull request #3550 from thedax/master
Browse files Browse the repository at this point in the history
Game loading: Fix a bug and prevent a "file is corrupt" error for demos/np PBPs that really aren't corrupt.
  • Loading branch information
hrydgard committed Sep 1, 2013
2 parents 3447023 + cd40856 commit cfbf83e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Core/Loaders.cpp
Expand Up @@ -162,6 +162,13 @@ bool LoadFile(std::string &filename, std::string *error_string) {

if (fileInfo.exists) {
INFO_LOG(LOADER, "File is a PBP in a directory!");
std::string ebootPath = filename + "/EBOOT.PBP";
IdentifiedFileType ebootType = Identify_File(ebootPath);
if(ebootType == FILETYPE_PSP_ISO_NP) {
InitMemoryForGameISO(ebootPath);
pspFileSystem.SetStartingDirectory("disc0:/PSP_GAME/USRDIR");
return Load_PSP_ISO(filename.c_str(), error_string);
}
std::string path = filename;
size_t pos = path.find("/PSP/GAME/");
if (pos != std::string::npos)
Expand Down Expand Up @@ -213,6 +220,7 @@ bool LoadFile(std::string &filename, std::string *error_string) {

case FILETYPE_NORMAL_DIRECTORY:
ERROR_LOG(LOADER, "Just a directory.");
*error_string = "Just a directory.";
break;

case FILETYPE_UNKNOWN_BIN:
Expand Down

0 comments on commit cfbf83e

Please sign in to comment.