mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-15 02:29:51 +01:00
Merge branch 'master' into TemporaryHackishBranch
# Conflicts: # Core/Config.cpp # Core/Config.h # UI/ControlMappingScreen.cpp # UI/EmuScreen.cpp # UI/GameSettingsScreen.cpp # android/assets/ui_atlas.meta # android/assets/ui_atlas.zim # assets/ui_atlas.meta # assets/ui_atlas.zim
This commit is contained in:
commit
4fb6e0c242
198 files changed
+6323
-2862
No files matched your search
+63
-22
@@ -78,6 +78,7 @@
|
||||
#include "Common/OSVersion.h"
|
||||
#include "Common/GPU/ShaderTranslation.h"
|
||||
|
||||
#include "Core/ControlMapper.h"
|
||||
#include "Core/Config.h"
|
||||
#include "Core/ConfigValues.h"
|
||||
#include "Core/Core.h"
|
||||
@@ -96,6 +97,7 @@
|
||||
#include "Core/Util/GameManager.h"
|
||||
#include "Core/Util/AudioFormat.h"
|
||||
#include "Core/WebServer.h"
|
||||
#include "Core/ThreadPools.h"
|
||||
|
||||
#include "GPU/GPUInterface.h"
|
||||
#include "UI/BackgroundAudio.h"
|
||||
@@ -120,6 +122,9 @@
|
||||
#if PPSSPP_PLATFORM(UWP)
|
||||
#include <dwrite_3.h>
|
||||
#endif
|
||||
#if PPSSPP_PLATFORM(ANDROID)
|
||||
#include "android/jni/app-android.h"
|
||||
#endif
|
||||
|
||||
// The new UI framework, for initialization
|
||||
|
||||
@@ -200,7 +205,7 @@ public:
|
||||
};
|
||||
|
||||
#ifdef _WIN32
|
||||
int Win32Mix(short *buffer, int numSamples, int bits, int rate, int channels) {
|
||||
int Win32Mix(short *buffer, int numSamples, int bits, int rate) {
|
||||
return NativeMix(buffer, numSamples);
|
||||
}
|
||||
#endif
|
||||
@@ -333,13 +338,26 @@ static void PostLoadConfig() {
|
||||
i18nrepo.LoadIni(g_Config.sLanguageIni);
|
||||
else
|
||||
i18nrepo.LoadIni(g_Config.sLanguageIni, langOverridePath);
|
||||
|
||||
g_threadManager.Init(cpu_info.num_cores, cpu_info.logical_cpu_count);
|
||||
}
|
||||
|
||||
void CreateDirectoriesAndroid() {
|
||||
static bool CreateDirectoriesAndroid() {
|
||||
// On Android, create a PSP directory tree in the external_dir,
|
||||
// to hopefully reduce confusion a bit.
|
||||
INFO_LOG(IO, "Creating %s", (g_Config.memStickDirectory / "PSP").c_str());
|
||||
File::CreateFullPath(g_Config.memStickDirectory / "PSP");
|
||||
|
||||
Path pspDir = g_Config.memStickDirectory;
|
||||
if (pspDir.GetFilename() != "PSP") {
|
||||
pspDir /= "PSP";
|
||||
}
|
||||
|
||||
INFO_LOG(IO, "Creating '%s' and subdirs:", pspDir.c_str());
|
||||
File::CreateFullPath(pspDir);
|
||||
if (!File::Exists(pspDir)) {
|
||||
INFO_LOG(IO, "Not a workable memstick directory. Giving up");
|
||||
return false;
|
||||
}
|
||||
|
||||
File::CreateFullPath(GetSysDirectory(DIRECTORY_SAVEDATA));
|
||||
File::CreateFullPath(GetSysDirectory(DIRECTORY_SAVESTATE));
|
||||
File::CreateFullPath(GetSysDirectory(DIRECTORY_GAME));
|
||||
@@ -354,6 +372,7 @@ void CreateDirectoriesAndroid() {
|
||||
File::CreateEmptyFile(GetSysDirectory(DIRECTORY_SYSTEM) / ".nomedia");
|
||||
File::CreateEmptyFile(GetSysDirectory(DIRECTORY_TEXTURES) / ".nomedia");
|
||||
File::CreateEmptyFile(GetSysDirectory(DIRECTORY_PLUGINS) / ".nomedia");
|
||||
return true;
|
||||
}
|
||||
|
||||
static void CheckFailedGPUBackends() {
|
||||
@@ -442,9 +461,6 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
|
||||
std::string user_data_path = savegame_dir;
|
||||
pendingMessages.clear();
|
||||
pendingInputBoxes.clear();
|
||||
#if PPSSPP_PLATFORM(IOS)
|
||||
user_data_path += "/";
|
||||
#endif
|
||||
|
||||
// external_dir has all kinds of meanings depending on platform.
|
||||
// on iOS it's even the path to bundled app assets. It's a mess.
|
||||
@@ -465,6 +481,7 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
|
||||
VFSRegister("", new DirectoryAssetReader(Path("/usr/share/ppsspp/assets")));
|
||||
VFSRegister("", new DirectoryAssetReader(Path("/usr/share/games/ppsspp/assets")));
|
||||
#endif
|
||||
|
||||
#if PPSSPP_PLATFORM(SWITCH)
|
||||
Path assetPath = Path(user_data_path) / "assets";
|
||||
VFSRegister("", new DirectoryAssetReader(assetPath));
|
||||
@@ -482,27 +499,47 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
|
||||
g_Config.defaultCurrentDirectory = Path("/");
|
||||
g_Config.internalDataDirectory = Path(savegame_dir);
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
// TODO: This needs to change in Android 12.
|
||||
//
|
||||
// Maybe there should be an option to use internal memory instead, but I think
|
||||
// that for most people, using external memory (SDCard/USB Storage) makes the
|
||||
// most sense.
|
||||
g_Config.defaultCurrentDirectory = Path(external_dir);
|
||||
#if PPSSPP_PLATFORM(ANDROID)
|
||||
// In Android 12 with scoped storage, due to the above, the external directory
|
||||
// is no longer the plain root of external storage, but it's an app specific directory
|
||||
// on external storage (g_extFilesDir).
|
||||
if (System_GetPropertyBool(SYSPROP_ANDROID_SCOPED_STORAGE)) {
|
||||
g_Config.defaultCurrentDirectory = Path(g_extFilesDir);
|
||||
} else {
|
||||
// Maybe there should be an option to use internal memory instead, but I think
|
||||
// that for most people, using external memory (SDCard/USB Storage) makes the
|
||||
// most sense.
|
||||
g_Config.defaultCurrentDirectory = Path(external_dir);
|
||||
}
|
||||
|
||||
// Might also add an option to move it to internal / non-visible storage, but there's
|
||||
// little point, really.
|
||||
|
||||
g_Config.memStickDirectory = Path(external_dir);
|
||||
g_Config.flash0Directory = Path(external_dir) / "flash0";
|
||||
|
||||
Path memstickDirFile = g_Config.internalDataDirectory / "memstick_dir.txt";
|
||||
if (File::Exists(memstickDirFile)) {
|
||||
std::string memstickDir;
|
||||
File::ReadFileToString(true, memstickDirFile, memstickDir);
|
||||
Path memstickPath(memstickDir);
|
||||
if (!memstickPath.empty() && File::Exists(memstickPath)) {
|
||||
g_Config.memStickDirectory = memstickPath;
|
||||
} else {
|
||||
ERROR_LOG(SYSTEM, "Couldn't read directory '%s' specified by memstick_dir.txt.", memstickDir.c_str());
|
||||
if (File::ReadFileToString(true, memstickDirFile, memstickDir)) {
|
||||
Path memstickPath(memstickDir);
|
||||
if (!memstickPath.empty() && File::Exists(memstickPath)) {
|
||||
g_Config.memStickDirectory = memstickPath;
|
||||
INFO_LOG(SYSTEM, "Memstick Directory from memstick_dir.txt: '%s'", g_Config.memStickDirectory.c_str());
|
||||
} else {
|
||||
ERROR_LOG(SYSTEM, "Couldn't read directory '%s' specified by memstick_dir.txt.", memstickDir.c_str());
|
||||
if (System_GetPropertyBool(SYSPROP_ANDROID_SCOPED_STORAGE)) {
|
||||
// TODO: Gotta resolve this somehow...
|
||||
// I think we wanna pop up the memstick dir chooser before any other screen in this case.
|
||||
// For now we just choose a default.
|
||||
g_Config.memStickDirectory = g_Config.defaultCurrentDirectory;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
INFO_LOG(SYSTEM, "No memstick directory file found. Using '%s'", memstickDirFile.c_str());
|
||||
}
|
||||
|
||||
#elif PPSSPP_PLATFORM(IOS)
|
||||
g_Config.defaultCurrentDirectory = g_Config.internalDataDirectory;
|
||||
g_Config.memStickDirectory = Path(user_data_path);
|
||||
@@ -1291,6 +1328,11 @@ bool NativeKey(const KeyInput &key) {
|
||||
}
|
||||
|
||||
bool NativeAxis(const AxisInput &axis) {
|
||||
if (!screenManager) {
|
||||
// Too early.
|
||||
return false;
|
||||
}
|
||||
|
||||
using namespace TiltEventProcessor;
|
||||
|
||||
// only handle tilt events if tilt is enabled.
|
||||
@@ -1304,8 +1346,7 @@ bool NativeAxis(const AxisInput &axis) {
|
||||
}
|
||||
|
||||
// create the base coordinate tilt system from the calibration data.
|
||||
// This is static for no particular reason, can be un-static'ed
|
||||
static Tilt baseTilt;
|
||||
Tilt baseTilt;
|
||||
baseTilt.x_ = g_Config.fTiltBaseX;
|
||||
baseTilt.y_ = g_Config.fTiltBaseY;
|
||||
|
||||
|
||||
Reference in new issue
Block a user