aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneonloop2021-08-12 15:30:51 +0000
committerneonloop2021-08-12 15:30:51 +0000
commit1aff43f93d09b207d97cdf18ccf8d28aedc49158 (patch)
tree3805c847e4b2ca04727a3e15a3c9ae9af99c3191
parent4f6bbfe3a4e16b3d322f9cd86a5f9ea1b8535d51 (diff)
downloadpicoarch-1aff43f93d09b207d97cdf18ccf8d28aedc49158.tar.gz
picoarch-1aff43f93d09b207d97cdf18ccf8d28aedc49158.tar.bz2
picoarch-1aff43f93d09b207d97cdf18ccf8d28aedc49158.zip
Places bios/etc in cwd/system rather than cwd
-rw-r--r--.gitignore3
-rw-r--r--core.c6
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