mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-22 21:09:52 +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())
|
||||
return;
|
||||
|
||||
const Path &path = File::GetExeDirectory();
|
||||
|
||||
const Path &exePath = File::GetExeDirectory();
|
||||
// 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.
|
||||
#if PPSSPP_PLATFORM(UWP)
|
||||
@ -726,7 +725,7 @@ void InitSysDirectories() {
|
||||
// Caller sets this to the Documents folder.
|
||||
const Path rootMyDocsPath = g_Config.internalDataDirectory;
|
||||
const Path myDocsPath = rootMyDocsPath / "PPSSPP";
|
||||
const Path installedFile = path / "installed.txt";
|
||||
const Path installedFile = exePath / "installed.txt";
|
||||
const bool installed = File::Exists(installedFile);
|
||||
|
||||
// If installed.txt exists(and we can determine the Documents directory)
|
||||
@ -751,7 +750,7 @@ void InitSysDirectories() {
|
||||
if (g_Config.memStickDirectory.empty())
|
||||
g_Config.memStickDirectory = myDocsPath;
|
||||
} 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
|
||||
@ -773,7 +772,10 @@ void InitSysDirectories() {
|
||||
if (File::Exists(testFile))
|
||||
File::Delete(testFile);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void CreateSysDirectories() {
|
||||
// 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.
|
||||
File::CreateDir(GetSysDirectory(DIRECTORY_PSP));
|
||||
@ -788,4 +790,3 @@ void InitSysDirectories() {
|
||||
g_Config.currentDirectory = GetSysDirectory(DIRECTORY_GAME);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -110,6 +110,8 @@ Path GetSysDirectory(PSPDirectories directoryType);
|
||||
void InitSysDirectories();
|
||||
#endif
|
||||
|
||||
void CreateSysDirectories();
|
||||
|
||||
// RUNNING must be at 0, NEXTFRAME must be at 1.
|
||||
enum CoreState {
|
||||
// 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();
|
||||
g_Config.internalDataDirectory = Path(internalDataFolderW);
|
||||
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
|
||||
// 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);
|
||||
|
||||
|
@ -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.
|
||||
g_Config.internalDataDirectory = Path(W32Util::UserDocumentsPath());
|
||||
InitSysDirectories();
|
||||
CreateSysDirectories();
|
||||
|
||||
// Check for the Vulkan workaround before any serious init.
|
||||
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
|
||||
// if it's not loaded here first.
|
||||
g_Config.SetSearchPath(GetSysDirectory(DIRECTORY_SYSTEM));
|
||||
|
@ -499,17 +499,22 @@ int main(int argc, const char* argv[])
|
||||
|
||||
#if PPSSPP_PLATFORM(WINDOWS)
|
||||
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
|
||||
|
||||
Path executablePath = File::GetExeDirectory();
|
||||
#if !PPSSPP_PLATFORM(ANDROID) && !PPSSPP_PLATFORM(WINDOWS)
|
||||
g_Config.memStickDirectory = Path(std::string(getenv("HOME"))) / ".ppsspp";
|
||||
g_Config.flash0Directory = executablePath / "assets/flash0";
|
||||
#endif
|
||||
|
||||
// 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) {
|
||||
if (File::Exists(nextPath / "assets/flash0")) {
|
||||
g_Config.flash0Directory = nextPath / "assets/flash0";
|
||||
|
@ -25,7 +25,6 @@
|
||||
|
||||
#include "Common/CommonWindows.h"
|
||||
|
||||
// TODO: Get rid of this junk
|
||||
class WindowsHeadlessHost : public HeadlessHost
|
||||
{
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user