mirror of
https://github.com/Oibaf66/uae-wii.git
synced 2024-11-14 23:05:08 +01:00
Path of last selected file remembered, A600 with 68000 cpu, getmodel function based on chipset and cpu
This commit is contained in:
parent
123760dac3
commit
e70dacb5f2
@ -698,6 +698,19 @@ static int cfgfile_path (const char *option, const char *value, const char *key)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cfgfile_path_noexpand (const char *option, const char *value, const char *key)
|
||||
{
|
||||
if (strcmp (option, key) == 0) {
|
||||
const char *path = strdup (value);
|
||||
|
||||
if (path)
|
||||
prefs_set_attr (key, path);
|
||||
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int getintval (char **p, int *result, int delim)
|
||||
{
|
||||
char *value = *p;
|
||||
@ -784,8 +797,13 @@ static int cfgfile_parse_host (struct uae_prefs *p, char *option, char *value)
|
||||
/* We special case the various path options here. */
|
||||
if (cfgfile_path (option, value, "rom_path"))
|
||||
return 1;
|
||||
if (cfgfile_path (option, value, "floppy_path"))
|
||||
#ifdef GEKKO
|
||||
if (cfgfile_path_noexpand (option, value, "floppy_path"))
|
||||
return 1;
|
||||
#else
|
||||
if (cfgfile_path (option, value, "floppy_path"))
|
||||
return 1;
|
||||
#endif
|
||||
if (cfgfile_path (option, value, "hardfile_path"))
|
||||
return 1;
|
||||
#ifdef SAVESTATE
|
||||
@ -2444,7 +2462,11 @@ void default_prefs (struct uae_prefs *p, int type)
|
||||
#endif
|
||||
|
||||
prefs_set_attr ("rom_path", strdup_path_expand (TARGET_ROM_PATH));
|
||||
prefs_set_attr ("floppy_path", strdup_path_expand (TARGET_FLOPPY_PATH));
|
||||
#ifdef GEKKO
|
||||
prefs_set_attr ("floppy_path", strdup(TARGET_FLOPPY_PATH)); //We don't want / at the end of path
|
||||
#else
|
||||
prefs_set_attr ("floppy_path", strdup_path_expand (TARGET_FLOPPY_PATH));
|
||||
#endif
|
||||
prefs_set_attr ("hardfile_path", strdup_path_expand (TARGET_HARDFILE_PATH));
|
||||
#ifdef SAVESTATE
|
||||
prefs_set_attr ("savestate_path", strdup_path_expand (TARGET_SAVESTATE_PATH));
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -916,6 +916,7 @@ static const char *menu_select_file_internal(const char *dir_path,
|
||||
char *sel;
|
||||
char *out;
|
||||
const char *ptr_selected_file;
|
||||
char *updir;
|
||||
int opt;
|
||||
int i;
|
||||
char buf[64];
|
||||
@ -944,6 +945,21 @@ static const char *menu_select_file_internal(const char *dir_path,
|
||||
|
||||
if (!sel)
|
||||
return NULL;
|
||||
|
||||
if (!strcmp(sel,"[..]")) //selected "[..]"
|
||||
{
|
||||
free((void*)sel);
|
||||
updir=strrchr(dir_path,'/');
|
||||
if (updir!=NULL) // found "/"
|
||||
{
|
||||
*updir=0; //trunk dir_path at last /
|
||||
if (strrchr(dir_path,'/')==NULL) {*updir='/'; *(updir+1)=0;} //check if it was root
|
||||
}
|
||||
|
||||
return menu_select_file(dir_path, selected_file, which);
|
||||
}
|
||||
|
||||
|
||||
/* If this is a folder, enter it recursively */
|
||||
if (sel[0] == '[')
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user