CPU_Init: Bail out earlier if we fail to identify a file.

This commit is contained in:
Henrik Rydgård 2024-10-31 23:56:36 +01:00
parent f690cb99a4
commit e93427c433
3 changed files with 11 additions and 4 deletions

View File

@ -6,6 +6,7 @@
#include "Common/TimeUtil.h"
#include "android/jni/app-android.h"
#include "Common/Thread/ThreadUtil.h"
#if PPSSPP_PLATFORM(ANDROID) && !defined(__LIBRETRO__)
@ -70,6 +71,13 @@ int Android_OpenContentUriFd(std::string_view filename, Android_OpenContentUriMo
return -1;
}
/*
// Should breakpoint here to try to find and move as many of these off the EmuThread as possible
if (!strcmp(GetCurrentThreadName(), "EmuThread")) {
WARN_LOG(Log::IO, "Content URI opened on EmuThread: %.*s", (int)filename.size(), filename.data());
}
*/
std::string fname(filename);
// PPSSPP adds an ending slash to directories before looking them up.
// TODO: Fix that in the caller (or don't call this for directories).

View File

@ -289,8 +289,8 @@ bool CPU_Init(std::string *errorString, FileLoader *loadedFile) {
break;
default:
// Can we even get here?
WARN_LOG(Log::Loader, "CPU_Init didn't recognize file. %s", errorString->c_str());
break;
ERROR_LOG(Log::Loader, "CPU_Init didn't recognize file. %s", errorString->c_str());
return false;
}
// Here we have read the PARAM.SFO, let's see if we need any compatibility overrides.

View File

@ -237,8 +237,7 @@ public class PpssppActivity extends NativeActivity {
public long computeRecursiveDirectorySize(String uriString) {
try {
Uri uri = Uri.parse(uriString);
long totalSize = directorySizeRecursion(uri);
return totalSize;
return directorySizeRecursion(uri);
}
catch (Exception e) {
Log.e(TAG, "computeRecursiveSize exception: " + e);