mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Merge pull request #12680 from unknownbrackets/ui-minor
UI: Ignore invalid PBPs in game browser
This commit is contained in:
commit
4b14b97178
1 changed files with 24 additions and 1 deletions
|
@ -36,6 +36,8 @@
|
||||||
#include "Core/System.h"
|
#include "Core/System.h"
|
||||||
#include "Core/Host.h"
|
#include "Core/Host.h"
|
||||||
#include "Core/Reporting.h"
|
#include "Core/Reporting.h"
|
||||||
|
#include "Core/ELF/PBPReader.h"
|
||||||
|
#include "Core/ELF/ParamSFO.h"
|
||||||
#include "Core/Util/GameManager.h"
|
#include "Core/Util/GameManager.h"
|
||||||
|
|
||||||
#include "UI/BackgroundAudio.h"
|
#include "UI/BackgroundAudio.h"
|
||||||
|
@ -598,6 +600,27 @@ void GameBrowser::Draw(UIContext &dc) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool IsValidPBP(const std::string &path) {
|
||||||
|
if (!File::Exists(path))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
std::unique_ptr<FileLoader> loader(ConstructFileLoader(path));
|
||||||
|
PBPReader pbp(loader.get());
|
||||||
|
std::vector<u8> sfoData;
|
||||||
|
if (!pbp.GetSubFile(PBP_PARAM_SFO, &sfoData))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
ParamSFOData sfo;
|
||||||
|
sfo.ReadSFO(sfoData);
|
||||||
|
if (sfo.GetValueString("DISC_ID").empty())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (sfo.GetValueString("CATEGORY") == "ME")
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void GameBrowser::Refresh() {
|
void GameBrowser::Refresh() {
|
||||||
using namespace UI;
|
using namespace UI;
|
||||||
|
|
||||||
|
@ -678,7 +701,7 @@ void GameBrowser::Refresh() {
|
||||||
bool isGame = !fileInfo[i].isDirectory;
|
bool isGame = !fileInfo[i].isDirectory;
|
||||||
bool isSaveData = false;
|
bool isSaveData = false;
|
||||||
// Check if eboot directory
|
// Check if eboot directory
|
||||||
if (!isGame && path_.GetPath().size() >= 4 && File::Exists(path_.GetPath() + fileInfo[i].name + "/EBOOT.PBP"))
|
if (!isGame && path_.GetPath().size() >= 4 && IsValidPBP(path_.GetPath() + fileInfo[i].name + "/EBOOT.PBP"))
|
||||||
isGame = true;
|
isGame = true;
|
||||||
else if (!isGame && File::Exists(path_.GetPath() + fileInfo[i].name + "/PSP_GAME/SYSDIR"))
|
else if (!isGame && File::Exists(path_.GetPath() + fileInfo[i].name + "/PSP_GAME/SYSDIR"))
|
||||||
isGame = true;
|
isGame = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue