2012-11-01 15:19:01 +00:00
|
|
|
// Copyright (c) 2012- PPSSPP Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
2012-11-04 22:01:49 +00:00
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
2012-11-01 15:19:01 +00:00
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
2014-11-25 19:47:58 +00:00
|
|
|
#include <algorithm>
|
|
|
|
#include <cstdio>
|
|
|
|
|
2015-12-28 03:25:28 +00:00
|
|
|
#include "base/stringutil.h"
|
2012-11-01 15:19:01 +00:00
|
|
|
#include "file/file_util.h"
|
2015-09-23 17:29:39 +00:00
|
|
|
#include "Common/FileUtil.h"
|
2012-11-01 15:19:01 +00:00
|
|
|
|
2015-06-27 17:58:44 +00:00
|
|
|
#include "Core/FileLoaders/CachingFileLoader.h"
|
2015-06-28 01:32:21 +00:00
|
|
|
#include "Core/FileLoaders/DiskCachingFileLoader.h"
|
2015-06-27 17:58:44 +00:00
|
|
|
#include "Core/FileLoaders/HTTPFileLoader.h"
|
|
|
|
#include "Core/FileLoaders/LocalFileLoader.h"
|
|
|
|
#include "Core/FileLoaders/RetryingFileLoader.h"
|
2013-12-29 22:28:31 +00:00
|
|
|
#include "Core/FileSystems/MetaFileSystem.h"
|
|
|
|
#include "Core/PSPLoaders.h"
|
|
|
|
#include "Core/MemMap.h"
|
|
|
|
#include "Core/Loaders.h"
|
|
|
|
#include "Core/System.h"
|
2014-03-03 16:46:26 +00:00
|
|
|
#include "Core/ELF/PBPReader.h"
|
|
|
|
#include "Core/ELF/ParamSFO.h"
|
2012-11-01 15:19:01 +00:00
|
|
|
|
2014-11-23 22:02:35 +00:00
|
|
|
FileLoader *ConstructFileLoader(const std::string &filename) {
|
2014-11-24 00:14:11 +00:00
|
|
|
if (filename.find("http://") == 0 || filename.find("https://") == 0)
|
2015-11-16 06:35:37 +00:00
|
|
|
return new CachingFileLoader(new DiskCachingFileLoader(new RetryingFileLoader(new HTTPFileLoader(filename))));
|
2014-11-23 22:02:35 +00:00
|
|
|
return new LocalFileLoader(filename);
|
|
|
|
}
|
|
|
|
|
2012-11-01 15:19:01 +00:00
|
|
|
// TODO : improve, look in the file more
|
2015-09-23 17:29:39 +00:00
|
|
|
IdentifiedFileType Identify_File(FileLoader *fileLoader) {
|
2014-11-23 21:25:32 +00:00
|
|
|
if (fileLoader == nullptr) {
|
|
|
|
ERROR_LOG(LOADER, "Invalid fileLoader");
|
|
|
|
return FILETYPE_ERROR;
|
|
|
|
}
|
|
|
|
if (fileLoader->Path().size() == 0) {
|
|
|
|
ERROR_LOG(LOADER, "Invalid filename %s", fileLoader->Path().c_str());
|
2013-06-08 15:48:41 +00:00
|
|
|
return FILETYPE_ERROR;
|
|
|
|
}
|
|
|
|
|
2014-11-23 21:25:32 +00:00
|
|
|
if (!fileLoader->Exists()) {
|
2013-09-01 23:49:15 +00:00
|
|
|
return FILETYPE_ERROR;
|
|
|
|
}
|
|
|
|
|
2014-11-23 21:25:32 +00:00
|
|
|
std::string extension = fileLoader->Extension();
|
2015-06-11 21:59:02 +00:00
|
|
|
if (!strcasecmp(extension.c_str(), ".iso"))
|
2013-06-09 21:09:13 +00:00
|
|
|
{
|
2013-09-01 23:49:15 +00:00
|
|
|
// may be a psx iso, they have 2352 byte sectors. You never know what some people try to open
|
2014-11-23 21:25:32 +00:00
|
|
|
if ((fileLoader->FileSize() % 2352) == 0)
|
2013-09-01 23:49:15 +00:00
|
|
|
{
|
|
|
|
unsigned char sync[12];
|
2014-11-23 21:25:32 +00:00
|
|
|
fileLoader->ReadAt(0, 12, sync);
|
2013-09-01 23:49:15 +00:00
|
|
|
|
|
|
|
// each sector in a mode2 image starts with these 12 bytes
|
|
|
|
if (memcmp(sync,"\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00",12) == 0)
|
|
|
|
{
|
|
|
|
return FILETYPE_ISO_MODE2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// maybe it also just happened to have that size,
|
|
|
|
}
|
2013-06-09 21:09:13 +00:00
|
|
|
return FILETYPE_PSP_ISO;
|
|
|
|
}
|
|
|
|
else if (!strcasecmp(extension.c_str(),".cso"))
|
|
|
|
{
|
|
|
|
return FILETYPE_PSP_ISO;
|
|
|
|
}
|
2015-06-11 21:59:02 +00:00
|
|
|
else if (!strcasecmp(extension.c_str(),".ppst"))
|
|
|
|
{
|
|
|
|
return FILETYPE_PPSSPP_SAVESTATE;
|
|
|
|
}
|
2013-06-08 15:48:41 +00:00
|
|
|
|
2013-09-01 23:50:43 +00:00
|
|
|
// First, check if it's a directory with an EBOOT.PBP in it.
|
2014-11-23 21:25:32 +00:00
|
|
|
if (fileLoader->IsDirectory()) {
|
|
|
|
std::string filename = fileLoader->Path();
|
2013-08-20 14:52:36 +00:00
|
|
|
if (filename.size() > 4) {
|
|
|
|
// Check for existence of EBOOT.PBP, as required for "Directory games".
|
2015-09-23 17:29:39 +00:00
|
|
|
if (File::Exists((filename + "/EBOOT.PBP").c_str())) {
|
|
|
|
return FILETYPE_PSP_PBP_DIRECTORY;
|
2013-06-08 15:48:41 +00:00
|
|
|
}
|
2013-07-23 15:24:33 +00:00
|
|
|
|
2013-08-20 14:52:36 +00:00
|
|
|
// check if it's a disc directory
|
2015-09-23 17:29:39 +00:00
|
|
|
if (File::Exists((filename + "/PSP_GAME").c_str())) {
|
|
|
|
return FILETYPE_PSP_DISC_DIRECTORY;
|
2013-07-23 15:24:33 +00:00
|
|
|
}
|
2015-06-11 18:22:16 +00:00
|
|
|
|
|
|
|
// Not that, okay, let's guess it's a savedata directory if it has a param.sfo...
|
2015-09-23 17:29:39 +00:00
|
|
|
if (File::Exists((filename + "/PARAM.SFO").c_str())) {
|
|
|
|
return FILETYPE_PSP_SAVEDATA_DIRECTORY;
|
2015-06-11 18:22:16 +00:00
|
|
|
}
|
2013-07-23 15:24:33 +00:00
|
|
|
}
|
2013-08-20 14:52:36 +00:00
|
|
|
|
|
|
|
return FILETYPE_NORMAL_DIRECTORY;
|
2013-06-08 15:48:41 +00:00
|
|
|
}
|
|
|
|
|
2013-07-27 23:05:21 +00:00
|
|
|
u32_le id;
|
2013-01-07 14:57:19 +00:00
|
|
|
|
2014-11-23 21:25:32 +00:00
|
|
|
size_t readSize = fileLoader->ReadAt(0, 4, 1, &id);
|
2013-06-08 15:48:41 +00:00
|
|
|
if (readSize != 1) {
|
2013-01-07 14:57:19 +00:00
|
|
|
return FILETYPE_ERROR;
|
2013-05-30 15:40:35 +00:00
|
|
|
}
|
2013-01-07 14:57:19 +00:00
|
|
|
|
2013-06-08 15:48:41 +00:00
|
|
|
u32 psar_offset = 0, psar_id = 0;
|
2013-08-17 13:12:42 +00:00
|
|
|
u32 _id = id;
|
|
|
|
switch (_id) {
|
2013-08-10 17:56:47 +00:00
|
|
|
case 'PBP\x00':
|
2014-11-23 21:25:32 +00:00
|
|
|
fileLoader->ReadAt(0x24, 4, 1, &psar_offset);
|
|
|
|
fileLoader->ReadAt(psar_offset, 4, 1, &psar_id);
|
2013-08-10 17:56:47 +00:00
|
|
|
break;
|
|
|
|
case '!raR':
|
|
|
|
return FILETYPE_ARCHIVE_RAR;
|
|
|
|
case '\x04\x03KP':
|
|
|
|
case '\x06\x05KP':
|
|
|
|
case '\x08\x07KP':
|
|
|
|
return FILETYPE_ARCHIVE_ZIP;
|
2013-06-08 15:48:41 +00:00
|
|
|
}
|
2013-05-08 15:36:57 +00:00
|
|
|
|
2013-08-10 17:56:47 +00:00
|
|
|
if (id == 'FLE\x7F') {
|
2014-11-23 21:25:32 +00:00
|
|
|
std::string filename = fileLoader->Path();
|
2013-06-22 16:50:40 +00:00
|
|
|
// There are a few elfs misnamed as pbp (like Trig Wars), accept that.
|
2013-06-08 15:48:41 +00:00
|
|
|
if (!strcasecmp(extension.c_str(), ".plf") || strstr(filename.c_str(),"BOOT.BIN") ||
|
2013-12-09 12:45:17 +00:00
|
|
|
!strcasecmp(extension.c_str(), ".elf") || !strcasecmp(extension.c_str(), ".prx") ||
|
2013-08-10 17:56:47 +00:00
|
|
|
!strcasecmp(extension.c_str(), ".pbp")) {
|
2012-11-01 15:19:01 +00:00
|
|
|
return FILETYPE_PSP_ELF;
|
|
|
|
}
|
2013-07-21 12:11:52 +00:00
|
|
|
return FILETYPE_UNKNOWN_ELF;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
2013-08-10 17:56:47 +00:00
|
|
|
else if (id == 'PBP\x00') {
|
2014-03-03 16:46:26 +00:00
|
|
|
// Do this PS1 eboot check FIRST before checking other eboot types.
|
|
|
|
// It seems like some are malformed and slip through the PSAR check below.
|
2015-12-24 18:40:25 +00:00
|
|
|
PBPReader pbp(fileLoader);
|
2015-12-24 18:20:27 +00:00
|
|
|
if (pbp.IsValid() && !pbp.IsELF()) {
|
|
|
|
std::vector<u8> sfoData;
|
|
|
|
if (pbp.GetSubFile(PBP_PARAM_SFO, &sfoData)) {
|
|
|
|
ParamSFOData paramSFO;
|
|
|
|
paramSFO.ReadSFO(sfoData);
|
|
|
|
// PS1 Eboots are supposed to use "ME" as their PARAM SFO category.
|
|
|
|
// If they don't, and they're still malformed (e.g. PSISOIMG0000 isn't found), there's nothing we can do.
|
|
|
|
if (paramSFO.GetValueString("CATEGORY") == "ME")
|
|
|
|
return FILETYPE_PSP_PS1_PBP;
|
2014-03-03 16:46:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-08 15:48:41 +00:00
|
|
|
if (psar_id == 'MUPN') {
|
2013-05-08 15:36:57 +00:00
|
|
|
return FILETYPE_PSP_ISO_NP;
|
2013-06-08 15:48:41 +00:00
|
|
|
}
|
2013-08-12 05:23:33 +00:00
|
|
|
// PS1 PSAR begins with "PSISOIMG0000"
|
|
|
|
if (psar_id == 'SISP') {
|
|
|
|
return FILETYPE_PSP_PS1_PBP;
|
|
|
|
}
|
2013-07-21 12:11:52 +00:00
|
|
|
|
|
|
|
// Let's check if we got pointed to a PBP within such a directory.
|
|
|
|
// If so we just move up and return the directory itself as the game.
|
2015-12-24 18:40:25 +00:00
|
|
|
std::string path = File::GetDir(fileLoader->Path());
|
2013-07-21 12:11:52 +00:00
|
|
|
// If loading from memstick...
|
|
|
|
size_t pos = path.find("/PSP/GAME/");
|
|
|
|
if (pos != std::string::npos) {
|
|
|
|
return FILETYPE_PSP_PBP_DIRECTORY;
|
|
|
|
}
|
|
|
|
return FILETYPE_PSP_PBP;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
2013-08-10 17:56:47 +00:00
|
|
|
else if (!strcasecmp(extension.c_str(),".pbp")) {
|
2013-07-21 12:11:52 +00:00
|
|
|
ERROR_LOG(LOADER, "A PBP with the wrong magic number?");
|
|
|
|
return FILETYPE_PSP_PBP;
|
2013-08-10 17:56:47 +00:00
|
|
|
} else if (!strcasecmp(extension.c_str(),".bin")) {
|
2013-07-21 12:11:52 +00:00
|
|
|
return FILETYPE_UNKNOWN_BIN;
|
2013-08-10 17:56:47 +00:00
|
|
|
} else if (!strcasecmp(extension.c_str(),".zip")) {
|
|
|
|
return FILETYPE_ARCHIVE_ZIP;
|
|
|
|
} else if (!strcasecmp(extension.c_str(),".rar")) {
|
|
|
|
return FILETYPE_ARCHIVE_RAR;
|
|
|
|
} else if (!strcasecmp(extension.c_str(),".r00")) {
|
|
|
|
return FILETYPE_ARCHIVE_RAR;
|
|
|
|
} else if (!strcasecmp(extension.c_str(),".r01")) {
|
|
|
|
return FILETYPE_ARCHIVE_RAR;
|
2016-05-27 01:04:24 +00:00
|
|
|
} else if (!extension.empty() && !strcasecmp(extension.substr(1).c_str(), ".7z")) {
|
2014-10-20 22:09:24 +00:00
|
|
|
return FILETYPE_ARCHIVE_7Z;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
return FILETYPE_UNKNOWN;
|
|
|
|
}
|
|
|
|
|
2015-12-28 03:25:28 +00:00
|
|
|
FileLoader *ResolveFileLoaderTarget(FileLoader *fileLoader) {
|
|
|
|
IdentifiedFileType type = Identify_File(fileLoader);
|
2016-06-27 03:33:25 +00:00
|
|
|
if (type == FILETYPE_PSP_PBP_DIRECTORY) {
|
|
|
|
const std::string ebootFilename = ResolvePBPFile(fileLoader->Path());
|
|
|
|
if (ebootFilename != fileLoader->Path()) {
|
|
|
|
// Switch fileLoader to the actual EBOOT.
|
|
|
|
delete fileLoader;
|
|
|
|
fileLoader = ConstructFileLoader(ebootFilename);
|
|
|
|
}
|
2015-12-28 03:25:28 +00:00
|
|
|
}
|
|
|
|
return fileLoader;
|
|
|
|
}
|
|
|
|
|
2016-06-27 03:33:25 +00:00
|
|
|
std::string ResolvePBPDirectory(const std::string &filename) {
|
|
|
|
bool hasPBP = endsWith(filename, "/EBOOT.PBP");
|
|
|
|
#ifdef _WIN32
|
|
|
|
hasPBP = hasPBP || endsWith(filename, "\\EBOOT.PBP");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (hasPBP) {
|
|
|
|
return filename.substr(0, filename.length() - strlen("/EBOOT.PBP"));
|
|
|
|
}
|
|
|
|
return filename;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string ResolvePBPFile(const std::string &filename) {
|
|
|
|
bool hasPBP = endsWith(filename, "/EBOOT.PBP");
|
|
|
|
#ifdef _WIN32
|
|
|
|
hasPBP = hasPBP || endsWith(filename, "\\EBOOT.PBP");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (!hasPBP) {
|
|
|
|
return filename + "/EBOOT.PBP";
|
|
|
|
}
|
|
|
|
return filename;
|
|
|
|
}
|
|
|
|
|
2014-11-23 22:08:14 +00:00
|
|
|
bool LoadFile(FileLoader **fileLoaderPtr, std::string *error_string) {
|
|
|
|
FileLoader *&fileLoader = *fileLoaderPtr;
|
2013-06-08 15:48:41 +00:00
|
|
|
// Note that this can modify filename!
|
2014-11-23 21:25:32 +00:00
|
|
|
switch (Identify_File(fileLoader)) {
|
2013-06-08 15:48:41 +00:00
|
|
|
case FILETYPE_PSP_PBP_DIRECTORY:
|
|
|
|
{
|
2015-12-28 03:25:28 +00:00
|
|
|
// TODO: Perhaps we should/can never get here now?
|
|
|
|
fileLoader = ResolveFileLoaderTarget(fileLoader);
|
2014-11-23 21:25:32 +00:00
|
|
|
if (fileLoader->Exists()) {
|
2013-06-08 15:48:41 +00:00
|
|
|
INFO_LOG(LOADER, "File is a PBP in a directory!");
|
2014-11-23 21:25:32 +00:00
|
|
|
IdentifiedFileType ebootType = Identify_File(fileLoader);
|
2014-02-25 04:15:49 +00:00
|
|
|
if (ebootType == FILETYPE_PSP_ISO_NP) {
|
2014-11-23 21:25:32 +00:00
|
|
|
InitMemoryForGameISO(fileLoader);
|
2013-09-01 17:25:42 +00:00
|
|
|
pspFileSystem.SetStartingDirectory("disc0:/PSP_GAME/USRDIR");
|
2014-11-23 21:59:56 +00:00
|
|
|
return Load_PSP_ISO(fileLoader, error_string);
|
2013-09-01 17:25:42 +00:00
|
|
|
}
|
2014-02-25 04:15:49 +00:00
|
|
|
else if (ebootType == FILETYPE_PSP_PS1_PBP) {
|
|
|
|
*error_string = "PS1 EBOOTs are not supported by PPSSPP.";
|
|
|
|
return false;
|
|
|
|
}
|
2015-12-28 03:25:28 +00:00
|
|
|
std::string path = fileLoader->Path();
|
2013-06-08 15:48:41 +00:00
|
|
|
size_t pos = path.find("/PSP/GAME/");
|
2015-12-28 03:25:28 +00:00
|
|
|
if (pos != std::string::npos) {
|
2016-06-27 03:33:25 +00:00
|
|
|
path = ResolvePBPDirectory(path);
|
2013-06-08 15:48:41 +00:00
|
|
|
pspFileSystem.SetStartingDirectory("ms0:" + path.substr(pos));
|
2015-12-28 03:25:28 +00:00
|
|
|
}
|
2014-11-23 21:59:56 +00:00
|
|
|
return Load_PSP_ELF_PBP(fileLoader, error_string);
|
2013-06-08 15:48:41 +00:00
|
|
|
} else {
|
|
|
|
*error_string = "No EBOOT.PBP, misidentified game";
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-01 15:19:01 +00:00
|
|
|
case FILETYPE_PSP_PBP:
|
|
|
|
case FILETYPE_PSP_ELF:
|
|
|
|
{
|
2013-06-08 15:48:41 +00:00
|
|
|
INFO_LOG(LOADER,"File is an ELF or loose PBP!");
|
2014-11-23 21:59:56 +00:00
|
|
|
return Load_PSP_ELF_PBP(fileLoader, error_string);
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
2013-06-08 15:48:41 +00:00
|
|
|
|
2012-11-01 15:19:01 +00:00
|
|
|
case FILETYPE_PSP_ISO:
|
2013-05-08 15:36:57 +00:00
|
|
|
case FILETYPE_PSP_ISO_NP:
|
2013-07-23 15:24:33 +00:00
|
|
|
case FILETYPE_PSP_DISC_DIRECTORY: // behaves the same as the mounting is already done by now
|
2013-01-10 11:27:10 +00:00
|
|
|
pspFileSystem.SetStartingDirectory("disc0:/PSP_GAME/USRDIR");
|
2014-11-23 21:59:56 +00:00
|
|
|
return Load_PSP_ISO(fileLoader, error_string);
|
2013-06-08 15:48:41 +00:00
|
|
|
|
2013-08-12 05:23:33 +00:00
|
|
|
case FILETYPE_PSP_PS1_PBP:
|
|
|
|
*error_string = "PS1 EBOOTs are not supported by PPSSPP.";
|
|
|
|
break;
|
|
|
|
|
2012-11-01 15:19:01 +00:00
|
|
|
case FILETYPE_ERROR:
|
2013-03-30 08:11:53 +00:00
|
|
|
ERROR_LOG(LOADER, "Could not read file");
|
2012-11-01 15:19:01 +00:00
|
|
|
*error_string = "Error reading file";
|
|
|
|
break;
|
2013-06-08 15:48:41 +00:00
|
|
|
|
2013-08-10 17:56:47 +00:00
|
|
|
case FILETYPE_ARCHIVE_RAR:
|
2013-08-23 07:52:28 +00:00
|
|
|
#ifdef WIN32
|
2013-09-03 10:42:12 +00:00
|
|
|
*error_string = "RAR file detected (Require WINRAR)";
|
2013-08-23 07:52:28 +00:00
|
|
|
#else
|
2013-09-03 10:42:12 +00:00
|
|
|
*error_string = "RAR file detected (Require UnRAR)";
|
2013-08-23 07:52:28 +00:00
|
|
|
#endif
|
2013-08-10 17:56:47 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FILETYPE_ARCHIVE_ZIP:
|
2013-08-23 07:52:28 +00:00
|
|
|
#ifdef WIN32
|
2013-09-03 10:42:12 +00:00
|
|
|
*error_string = "ZIP file detected (Require WINRAR)";
|
2013-08-23 07:52:28 +00:00
|
|
|
#else
|
2013-09-03 10:42:12 +00:00
|
|
|
*error_string = "ZIP file detected (Require UnRAR)";
|
2013-08-23 07:52:28 +00:00
|
|
|
#endif
|
2013-08-10 17:56:47 +00:00
|
|
|
break;
|
|
|
|
|
2014-10-20 22:09:24 +00:00
|
|
|
case FILETYPE_ARCHIVE_7Z:
|
|
|
|
#ifdef WIN32
|
|
|
|
*error_string = "7z file detected (Require 7-Zip)";
|
|
|
|
#else
|
|
|
|
*error_string = "7z file detected (Require 7-Zip)";
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
|
2013-09-01 23:49:15 +00:00
|
|
|
case FILETYPE_ISO_MODE2:
|
2013-09-04 11:48:22 +00:00
|
|
|
*error_string = "PSX game image detected.";
|
2013-09-01 23:49:15 +00:00
|
|
|
break;
|
|
|
|
|
2013-08-20 14:52:36 +00:00
|
|
|
case FILETYPE_NORMAL_DIRECTORY:
|
|
|
|
ERROR_LOG(LOADER, "Just a directory.");
|
2013-09-01 17:25:42 +00:00
|
|
|
*error_string = "Just a directory.";
|
2013-08-20 14:52:36 +00:00
|
|
|
break;
|
|
|
|
|
2015-06-12 12:46:34 +00:00
|
|
|
case FILETYPE_PPSSPP_SAVESTATE:
|
|
|
|
*error_string = "This is a saved state, not a game."; // Actually, we could make it load it...
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FILETYPE_PSP_SAVEDATA_DIRECTORY:
|
|
|
|
*error_string = "This is save data, not a game."; // Actually, we could make it load it...
|
|
|
|
break;
|
|
|
|
|
2012-11-01 15:19:01 +00:00
|
|
|
case FILETYPE_UNKNOWN_BIN:
|
|
|
|
case FILETYPE_UNKNOWN_ELF:
|
|
|
|
case FILETYPE_UNKNOWN:
|
|
|
|
default:
|
2013-01-07 08:10:05 +00:00
|
|
|
ERROR_LOG(LOADER, "Failed to identify file");
|
2013-05-13 02:51:16 +00:00
|
|
|
*error_string = "Failed to identify file";
|
2012-11-01 15:19:01 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|