From 1aff43f93d09b207d97cdf18ccf8d28aedc49158 Mon Sep 17 00:00:00 2001 From: neonloop Date: Thu, 12 Aug 2021 15:30:51 +0000 Subject: Places bios/etc in cwd/system rather than cwd --- .gitignore | 3 ++- core.c | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 182cac4..fa217e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,9 @@ *.o *.so +picoarch /pkg /profile -picoarch +/system /fbalpha2012 /gambatte diff --git a/core.c b/core.c index bb37aa8..37a2368 100644 --- a/core.c +++ b/core.c @@ -212,6 +212,7 @@ error: static void set_directories(void) { const char *home = getenv("HOME"); + char cwd[MAX_PATH]; char *dst = save_dir; int len = MAX_PATH; @@ -225,7 +226,10 @@ static void set_directories(void) { #ifdef MINUI strncpy(system_dir, save_dir, MAX_PATH-1); #else - if (!getcwd(system_dir, MAX_PATH)) { + if (getcwd(cwd, MAX_PATH)) { + snprintf(system_dir, MAX_PATH, "%s/system", cwd); + mkdir(system_dir, 0755); + } else { PA_FATAL("Can't find system directory"); } #endif -- cgit v1.2.3