diff options
author | Ian C <ianc@noddybox.co.uk> | 2023-04-23 10:30:44 +0800 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2023-04-23 10:30:44 +0800 |
commit | 62e0729de4b856d1230e5fd2d6558c188386a683 (patch) | |
tree | c62ba2584aed4cf19ce0a1592305c806fde9dde9 /source/gui.c | |
parent | d68d6a14ba9c37eef243d6b739d590ec0f05c6c4 (diff) |
Diffstat (limited to 'source/gui.c')
-rw-r--r-- | source/gui.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/source/gui.c b/source/gui.c index bf1feb5..c68fafd 100644 --- a/source/gui.c +++ b/source/gui.c @@ -59,6 +59,8 @@ typedef struct static FSEL_File fsel[FSEL_MAX_FILES]; +char last_dir[FILENAME_MAX] = "sdmc:/ZX81/"; + static void CheckPath(char *path) { @@ -180,7 +182,7 @@ static int LoadDir(const char *path, const char *filter) if ((dir = opendir(path))) { - if (strcmp(path, "/") != 0) + if (strcmp(path, "sdmc:/") != 0) { strcpy(fsel[no].name, ".."); fsel[no].is_dir = TRUE; @@ -216,6 +218,21 @@ static int LoadDir(const char *path, const char *filter) /* ---------------------------------------- PUBLIC INTERFACES */ +void GUI_Init(void) +{ + DIR *dir; + + if ((dir = opendir(last_dir))) + { + closedir(dir); + } + else + { + strcpy(last_dir, "sdmc:/"); + } +} + + int GUI_Menu(const char *opts[]) { int x,y; |