diff --git a/src/studio/fs.c b/src/studio/fs.c index 8246cce7d..9e076a760 100644 --- a/src/studio/fs.c +++ b/src/studio/fs.c @@ -112,11 +112,17 @@ static bool isRoot(tic_fs* fs) return fs->work[0] == '\0'; } +bool tic_fs_isroot(tic_fs* fs) +{ + return isRoot(fs); +} + static bool isPublicRoot(tic_fs* fs) { return strcmp(fs->work, PublicDir) == 0; } + static bool isPublic(tic_fs* fs) { return memcmp(fs->work, PublicDir, STRLEN(PublicDir)) == 0; diff --git a/src/studio/fs.h b/src/studio/fs.h index 3623908bb..2bcab7982 100644 --- a/src/studio/fs.h +++ b/src/studio/fs.h @@ -50,6 +50,7 @@ bool tic_fs_makedir (tic_fs* fs, const char* name); bool tic_fs_exists (tic_fs* fs, const char* name); void tic_fs_openfolder (tic_fs* fs); bool tic_fs_isdir (tic_fs* fs, const char* dir); +bool tic_fs_isroot (tic_fs* fs); bool tic_fs_ispubdir (tic_fs* fs); void tic_fs_changedir (tic_fs* fs, const char* dir); void tic_fs_dir (tic_fs* fs, char* out); diff --git a/src/studio/screens/surf.c b/src/studio/screens/surf.c index 398a12747..0623c0a0b 100644 --- a/src/studio/screens/surf.c +++ b/src/studio/screens/surf.c @@ -693,7 +693,8 @@ static void processGamepad(Surf* surf) if(tic_api_btnp(tic, B, -1, -1) || tic_api_keyp(tic, tic_key_backspace, -1, -1)) { - goBackDir(surf); + if(tic_fs_isroot(surf->fs)) setStudioMode(surf->studio, TIC_CONSOLE_MODE); + else goBackDir(surf); } #ifdef CAN_OPEN_URL