diff options
| author | neonloop | 2023-07-22 19:29:58 +0000 | 
|---|---|---|
| committer | neonloop | 2023-07-22 19:29:58 +0000 | 
| commit | ecb3c7bf765a84413ac0a53ffca7c8bf470c821f (patch) | |
| tree | dab03af97c70fde6361b051c7be2851ea5d350ca /menu.c | |
| parent | 9efef9e19a4310f02b4c69a6d79ed9242c88aa34 (diff) | |
| download | picoarch-ecb3c7bf765a84413ac0a53ffca7c8bf470c821f.tar.gz picoarch-ecb3c7bf765a84413ac0a53ffca7c8bf470c821f.tar.bz2 picoarch-ecb3c7bf765a84413ac0a53ffca7c8bf470c821f.zip | |
Opens internal file browser to last played content on core
Diffstat (limited to 'menu.c')
| -rw-r--r-- | menu.c | 20 | 
1 files changed, 14 insertions, 6 deletions
| @@ -250,17 +250,25 @@ const char *select_content(void) {  	if (content && strlen(content->path)) {  		strncpy(content_path, content->path, sizeof(content_path) - 1); -	} else if (getenv("CONTENT_DIR")) { -		strncpy(content_path, getenv("CONTENT_DIR"), sizeof(content_path) - 1); -#ifdef CONTENT_DIR  	} else { -		strncpy(content_path, CONTENT_DIR, sizeof(content_path) - 1); +		core_load_last_opened(content_path, sizeof(content_path)); +	} + +	if (!content_path[0]) { +		if (getenv("CONTENT_DIR")) { +			strncpy(content_path, getenv("CONTENT_DIR"), sizeof(content_path) - 1); +#ifdef CONTENT_DIR +		} else { +			strncpy(content_path, CONTENT_DIR, sizeof(content_path) - 1);  #else -	} else if (getenv("HOME")) { -		strncpy(content_path, getenv("HOME"), sizeof(content_path) - 1); +		} else if (getenv("HOME")) { +			strncpy(content_path, getenv("HOME"), sizeof(content_path) - 1);  #endif +		}  	} +	content_path[sizeof(content_path) - 1] = '\0'; +  	if (extensions) {  		for (size = 0; extensions[size]; size++)  			; | 
