mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-26 23:10:38 +00:00
Windows: Split out Create... from InitSysDirectories, fixup uses
This commit is contained in:
parent
3f3c5edaff
commit
6f6ea4595a
@ -713,10 +713,9 @@ void InitSysDirectories() {
|
|||||||
if (!g_Config.memStickDirectory.empty() && !g_Config.flash0Directory.empty())
|
if (!g_Config.memStickDirectory.empty() && !g_Config.flash0Directory.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const Path &path = File::GetExeDirectory();
|
const Path &exePath = File::GetExeDirectory();
|
||||||
|
|
||||||
// Mount a filesystem
|
// Mount a filesystem
|
||||||
g_Config.flash0Directory = path / "assets/flash0";
|
g_Config.flash0Directory = exePath / "assets/flash0";
|
||||||
|
|
||||||
// Detect the "My Documents"(XP) or "Documents"(on Vista/7/8) folder.
|
// Detect the "My Documents"(XP) or "Documents"(on Vista/7/8) folder.
|
||||||
#if PPSSPP_PLATFORM(UWP)
|
#if PPSSPP_PLATFORM(UWP)
|
||||||
@ -726,7 +725,7 @@ void InitSysDirectories() {
|
|||||||
// Caller sets this to the Documents folder.
|
// Caller sets this to the Documents folder.
|
||||||
const Path rootMyDocsPath = g_Config.internalDataDirectory;
|
const Path rootMyDocsPath = g_Config.internalDataDirectory;
|
||||||
const Path myDocsPath = rootMyDocsPath / "PPSSPP";
|
const Path myDocsPath = rootMyDocsPath / "PPSSPP";
|
||||||
const Path installedFile = path / "installed.txt";
|
const Path installedFile = exePath / "installed.txt";
|
||||||
const bool installed = File::Exists(installedFile);
|
const bool installed = File::Exists(installedFile);
|
||||||
|
|
||||||
// If installed.txt exists(and we can determine the Documents directory)
|
// If installed.txt exists(and we can determine the Documents directory)
|
||||||
@ -751,7 +750,7 @@ void InitSysDirectories() {
|
|||||||
if (g_Config.memStickDirectory.empty())
|
if (g_Config.memStickDirectory.empty())
|
||||||
g_Config.memStickDirectory = myDocsPath;
|
g_Config.memStickDirectory = myDocsPath;
|
||||||
} else {
|
} else {
|
||||||
g_Config.memStickDirectory = path / "memstick";
|
g_Config.memStickDirectory = exePath / "memstick";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the memstickpath before trying to write to it, and fall back on Documents yet again
|
// Create the memstickpath before trying to write to it, and fall back on Documents yet again
|
||||||
@ -773,7 +772,10 @@ void InitSysDirectories() {
|
|||||||
if (File::Exists(testFile))
|
if (File::Exists(testFile))
|
||||||
File::Delete(testFile);
|
File::Delete(testFile);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void CreateSysDirectories() {
|
||||||
// Create the default directories that a real PSP creates. Good for homebrew so they can
|
// Create the default directories that a real PSP creates. Good for homebrew so they can
|
||||||
// expect a standard environment. Skipping THEME though, that's pointless.
|
// expect a standard environment. Skipping THEME though, that's pointless.
|
||||||
File::CreateDir(GetSysDirectory(DIRECTORY_PSP));
|
File::CreateDir(GetSysDirectory(DIRECTORY_PSP));
|
||||||
@ -788,4 +790,3 @@ void InitSysDirectories() {
|
|||||||
g_Config.currentDirectory = GetSysDirectory(DIRECTORY_GAME);
|
g_Config.currentDirectory = GetSysDirectory(DIRECTORY_GAME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
@ -110,6 +110,8 @@ Path GetSysDirectory(PSPDirectories directoryType);
|
|||||||
void InitSysDirectories();
|
void InitSysDirectories();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void CreateSysDirectories();
|
||||||
|
|
||||||
// RUNNING must be at 0, NEXTFRAME must be at 1.
|
// RUNNING must be at 0, NEXTFRAME must be at 1.
|
||||||
enum CoreState {
|
enum CoreState {
|
||||||
// Emulation is running normally.
|
// Emulation is running normally.
|
||||||
|
@ -103,10 +103,12 @@ PPSSPP_UWPMain::PPSSPP_UWPMain(App ^app, const std::shared_ptr<DX::DeviceResourc
|
|||||||
std::wstring internalDataFolderW = ApplicationData::Current->LocalFolder->Path->Data();
|
std::wstring internalDataFolderW = ApplicationData::Current->LocalFolder->Path->Data();
|
||||||
g_Config.internalDataDirectory = Path(internalDataFolderW);
|
g_Config.internalDataDirectory = Path(internalDataFolderW);
|
||||||
g_Config.memStickDirectory = g_Config.internalDataDirectory;
|
g_Config.memStickDirectory = g_Config.internalDataDirectory;
|
||||||
|
// Mount a filesystem
|
||||||
|
g_Config.flash0Directory = exePath / "assets/flash0";
|
||||||
|
|
||||||
// On Win32 it makes more sense to initialize the system directories here
|
// On Win32 it makes more sense to initialize the system directories here
|
||||||
// because the next place it was called was in the EmuThread, and it's too late by then.
|
// because the next place it was called was in the EmuThread, and it's too late by then.
|
||||||
InitSysDirectories();
|
CreateSysDirectories();
|
||||||
|
|
||||||
LogManager::Init(&g_Config.bEnableLogging);
|
LogManager::Init(&g_Config.bEnableLogging);
|
||||||
|
|
||||||
|
@ -822,6 +822,7 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
|
|||||||
// because the next place it was called was in the EmuThread, and it's too late by then.
|
// because the next place it was called was in the EmuThread, and it's too late by then.
|
||||||
g_Config.internalDataDirectory = Path(W32Util::UserDocumentsPath());
|
g_Config.internalDataDirectory = Path(W32Util::UserDocumentsPath());
|
||||||
InitSysDirectories();
|
InitSysDirectories();
|
||||||
|
CreateSysDirectories();
|
||||||
|
|
||||||
// Check for the Vulkan workaround before any serious init.
|
// Check for the Vulkan workaround before any serious init.
|
||||||
for (size_t i = 1; i < wideArgs.size(); ++i) {
|
for (size_t i = 1; i < wideArgs.size(); ++i) {
|
||||||
@ -839,6 +840,7 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Load config up here, because those changes below would be overwritten
|
// Load config up here, because those changes below would be overwritten
|
||||||
// if it's not loaded here first.
|
// if it's not loaded here first.
|
||||||
g_Config.SetSearchPath(GetSysDirectory(DIRECTORY_SYSTEM));
|
g_Config.SetSearchPath(GetSysDirectory(DIRECTORY_SYSTEM));
|
||||||
|
@ -499,17 +499,22 @@ int main(int argc, const char* argv[])
|
|||||||
|
|
||||||
#if PPSSPP_PLATFORM(WINDOWS)
|
#if PPSSPP_PLATFORM(WINDOWS)
|
||||||
g_Config.internalDataDirectory.clear();
|
g_Config.internalDataDirectory.clear();
|
||||||
InitSysDirectories();
|
|
||||||
|
Path exePath = File::GetExeDirectory();
|
||||||
|
// Mount a filesystem
|
||||||
|
g_Config.flash0Directory = exePath / "assets/flash0";
|
||||||
|
g_Config.memStickDirectory = exePath / "memstick";
|
||||||
|
File::CreateDir(g_Config.memStickDirectory);
|
||||||
|
CreateSysDirectories();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Path executablePath = File::GetExeDirectory();
|
|
||||||
#if !PPSSPP_PLATFORM(ANDROID) && !PPSSPP_PLATFORM(WINDOWS)
|
#if !PPSSPP_PLATFORM(ANDROID) && !PPSSPP_PLATFORM(WINDOWS)
|
||||||
g_Config.memStickDirectory = Path(std::string(getenv("HOME"))) / ".ppsspp";
|
g_Config.memStickDirectory = Path(std::string(getenv("HOME"))) / ".ppsspp";
|
||||||
g_Config.flash0Directory = executablePath / "assets/flash0";
|
g_Config.flash0Directory = executablePath / "assets/flash0";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Try to find the flash0 directory. Often this is from a subdirectory.
|
// Try to find the flash0 directory. Often this is from a subdirectory.
|
||||||
Path nextPath = executablePath;
|
Path nextPath = exePath;
|
||||||
for (int i = 0; i < 5; ++i) {
|
for (int i = 0; i < 5; ++i) {
|
||||||
if (File::Exists(nextPath / "assets/flash0")) {
|
if (File::Exists(nextPath / "assets/flash0")) {
|
||||||
g_Config.flash0Directory = nextPath / "assets/flash0";
|
g_Config.flash0Directory = nextPath / "assets/flash0";
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
#include "Common/CommonWindows.h"
|
#include "Common/CommonWindows.h"
|
||||||
|
|
||||||
// TODO: Get rid of this junk
|
|
||||||
class WindowsHeadlessHost : public HeadlessHost
|
class WindowsHeadlessHost : public HeadlessHost
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user