diff --git a/command.c b/command.c index 050d0e73dc..125370dc85 100644 --- a/command.c +++ b/command.c @@ -846,7 +846,9 @@ static void command_event_disk_control_set_eject(bool new_state, bool print_log) if (control->set_eject_state(new_state)) snprintf(msg, sizeof(msg), "%s %s", - new_state ? "Ejected" : "Closed", + new_state ? + msg_hash_to_str(MSG_DISK_EJECTED) : + msg_hash_to_str(MSG_DISK_CLOSED), msg_hash_to_str(MSG_VIRTUAL_DISK_TRAY)); else { @@ -969,7 +971,7 @@ static bool command_event_disk_control_append_image(const char *path) command_event(CMD_EVENT_AUTOSAVE_DEINIT, NULL); /* TODO: Need to figure out what to do with subsystems case. */ - if (!*global->subsystem) + if (string_is_empty(global->subsystem)) { /* Update paths for our new image. * If we actually use append_image, we assume that we @@ -1460,9 +1462,13 @@ static bool command_event_save_core_config(void) fill_pathname_join(config_path, config_dir, config_name, sizeof(config_path)); if (i) - snprintf(tmp, sizeof(tmp), "-%u.cfg", i); + snprintf(tmp, sizeof(tmp), "-%u%s", + i, + file_path_str(FILE_PATH_CONFIG_EXTENSION)); else - strlcpy(tmp, ".cfg", sizeof(tmp)); + strlcpy(tmp, + file_path_str(FILE_PATH_CONFIG_EXTENSION), + sizeof(tmp)); strlcat(config_path, tmp, sizeof(config_path)); if (!path_file_exists(config_path)) @@ -1477,7 +1483,9 @@ static bool command_event_save_core_config(void) if (!found_path) { RARCH_WARN("Cannot infer new config path. Use current time.\n"); - fill_dated_filename(config_name, "cfg", sizeof(config_name)); + fill_dated_filename(config_name, + file_path_str(FILE_PATH_CONFIG_EXTENSION), + sizeof(config_name)); fill_pathname_join(config_path, config_dir, config_name, sizeof(config_path)); } @@ -1774,7 +1782,7 @@ bool command_event(enum event_command cmd, void *data) core_info_ctx_find_t info_find; #if defined(HAVE_DYNAMIC) - if (!(*settings->path.libretro)) + if (string_is_empty(settings->path.libretro)) return false; libretro_get_system_info( diff --git a/file_path_special.h b/file_path_special.h index 6a9f510966..5c06df712e 100644 --- a/file_path_special.h +++ b/file_path_special.h @@ -49,6 +49,7 @@ enum file_path_enum FILE_PATH_RTC_EXTENSION, FILE_PATH_CHT_EXTENSION, FILE_PATH_LPL_EXTENSION, + FILE_PATH_CONFIG_EXTENSION, FILE_PATH_CORE_INFO_EXTENSION }; diff --git a/file_path_str.c b/file_path_str.c index 931dda62a5..21f95f18ec 100644 --- a/file_path_str.c +++ b/file_path_str.c @@ -27,6 +27,8 @@ const char *file_path_str(enum file_path_enum enum_idx) #endif case FILE_PATH_CORE_INFO_EXTENSION: return ".info"; + case FILE_PATH_CONFIG_EXTENSION: + return ".cfg"; case FILE_PATH_RTC_EXTENSION: return ".rtc"; case FILE_PATH_CHT_EXTENSION: diff --git a/intl/msg_hash_us.c b/intl/msg_hash_us.c index 719d03fd7d..d8ca553e05 100644 --- a/intl/msg_hash_us.c +++ b/intl/msg_hash_us.c @@ -1995,6 +1995,10 @@ const char *msg_hash_to_str_us(enum msg_hash_enums msg) return "Frontend for libretro"; case MSG_LOADING: return "Loading"; + case MSG_DISK_EJECTED: + return "Ejected"; + case MSG_DISK_CLOSED: + return "Closed"; case MSG_VERSION_OF_LIBRETRO_API: return "Version of libretro API"; case MSG_COMPILED_AGAINST_API: diff --git a/msg_hash.h b/msg_hash.h index 3ff5d5c7b7..3ef6705eac 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -141,6 +141,8 @@ enum msg_hash_enums MSG_REVERTING_SAVEFILE_DIRECTORY_TO, MSG_ERROR_PARSING_ARGUMENTS, MSG_REVERTING_SAVESTATE_DIRECTORY_TO, + MSG_DISK_EJECTED, + MSG_DISK_CLOSED, MSG_REWIND_INIT, MSG_REWIND_INIT_FAILED, MSG_REWIND_INIT_FAILED_THREADED_AUDIO,