summaryrefslogtreecommitdiff
path: root/source/gui.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2021-08-09 18:50:11 +0000
committerIan C <ianc@noddybox.co.uk>2021-08-09 18:50:11 +0000
commit37236919c76ed4b5a8a7c98950257e3626e268c4 (patch)
tree22bdc153fc4e30a18a8d4f180ab5a19cfbbb3999 /source/gui.c
parent0d08766ccc80cacfe0690cb8a1ea8f13038e404b (diff)
Changed initial directory and added joystick emulation.
Diffstat (limited to 'source/gui.c')
-rw-r--r--source/gui.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/source/gui.c b/source/gui.c
index 375fc74..c3b402d 100644
--- a/source/gui.c
+++ b/source/gui.c
@@ -54,12 +54,11 @@ typedef struct
{
char name[FSEL_FILENAME_LEN+1];
int is_dir;
- int size;
} FSEL_File;
static FSEL_File fsel[FSEL_MAX_FILES];
-char last_dir[FILENAME_MAX] = "sdmc:/";
+char last_dir[FILENAME_MAX] = "sdmc:/SPECTRUM/";
static void CheckPath(char *path)
@@ -185,7 +184,6 @@ static int LoadDir(const char *path, const char *filter)
{
strcpy(fsel[no].name, "..");
fsel[no].is_dir = TRUE;
- fsel[no].size = 0;
no++;
}
@@ -199,7 +197,6 @@ static int LoadDir(const char *path, const char *filter)
{
strcpy(fsel[no].name,ent->d_name);
fsel[no].is_dir = ent->d_type & DT_DIR;
- fsel[no].size = 0;
no++;
}
}
@@ -215,6 +212,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;