This commit is contained in:
twinaphex 2016-10-22 05:10:13 +02:00
parent 149e7768a0
commit 1b944c1cce
3 changed files with 40 additions and 25 deletions

View File

@ -1922,6 +1922,12 @@ static const char *menu_hash_to_str_us_label_enum(enum msg_hash_enums msg)
return "shutting_down"; return "shutting_down";
case MSG_AUTODETECT: case MSG_AUTODETECT:
return "Autodetect"; return "Autodetect";
case MSG_SUCCEEDED:
return "succeeded";
case MSG_FAILED:
return "failed";
case MSG_AUTOLOADING_SAVESTATE_FROM:
return "Auto-loading savestate from";
case MSG_REBOOTING: case MSG_REBOOTING:
return "rebooting"; return "rebooting";
case MSG_CONNECTING_TO_PORT: case MSG_CONNECTING_TO_PORT:
@ -3171,8 +3177,6 @@ const char *msg_hash_to_str_us(enum msg_hash_enums msg)
return "Sorry, unimplemented: cores that don't demand content cannot participate in netplay."; return "Sorry, unimplemented: cores that don't demand content cannot participate in netplay.";
case MSG_FOUND_AUTO_SAVESTATE_IN: case MSG_FOUND_AUTO_SAVESTATE_IN:
return "Found auto savestate in"; return "Found auto savestate in";
case MSG_AUTOLOADING_SAVESTATE_FROM:
return "Auto-loading savestate from";
case MENU_ENUM_LABEL_VALUE_NETWORK_REMOTE_PORT: case MENU_ENUM_LABEL_VALUE_NETWORK_REMOTE_PORT:
return "Network Remote Base Port"; return "Network Remote Base Port";
case MSG_OVERRIDES_SAVED_SUCCESSFULLY: case MSG_OVERRIDES_SAVED_SUCCESSFULLY:

View File

@ -136,6 +136,8 @@ enum msg_hash_enums
MSG_DEVICE_CONFIGURED_IN_PORT, MSG_DEVICE_CONFIGURED_IN_PORT,
MSG_DEVICE_NOT_CONFIGURED, MSG_DEVICE_NOT_CONFIGURED,
MSG_DEVICE_DISCONNECTED_FROM_PORT, MSG_DEVICE_DISCONNECTED_FROM_PORT,
MSG_FAILED,
MSG_SUCCEEDED,
MSG_LOADING, MSG_LOADING,
MSG_CONNECTING_TO_PORT, MSG_CONNECTING_TO_PORT,
MSG_CONNECTED_TO, MSG_CONNECTED_TO,

View File

@ -741,8 +741,10 @@ static void task_load_handler(retro_task_t *task)
msg[0] = '\0'; msg[0] = '\0';
snprintf(msg, sizeof(msg), "Auto-loading savestate from \"%s\" failed.", snprintf(msg, sizeof(msg), "%s \"%s\" %s.",
state->path); msg_hash_to_str(MSG_AUTOLOADING_SAVESTATE_FROM),
state->path,
msg_hash_to_str(MSG_FAILED));
task->error = strdup(msg); task->error = strdup(msg);
} }
else else
@ -770,8 +772,10 @@ static void task_load_handler(retro_task_t *task)
if (state->autoload) if (state->autoload)
{ {
snprintf(msg, sizeof(msg), "Auto-loading savestate from \"%s\" succeeded.", snprintf(msg, sizeof(msg), "%s \"%s\" %s.",
state->path); msg_hash_to_str(MSG_AUTOLOADING_SAVESTATE_FROM),
state->path,
msg_hash_to_str(MSG_SUCCEEDED));
if (!task->mute) if (!task->mute)
runloop_msg_queue_push(msg, 1, 180, true); runloop_msg_queue_push(msg, 1, 180, true);
} }
@ -945,8 +949,11 @@ static void content_load_state_cb(void *task_data,
error: error:
if (load_data->autoload) if (load_data->autoload)
snprintf(err_buf, sizeof(err_buf), "Auto-loading savestate from \"%s\" failed.", snprintf(err_buf, sizeof(err_buf), "%s \"%s\" %s.",
load_data->path); msg_hash_to_str(MSG_AUTOLOADING_SAVESTATE_FROM),
load_data->path,
msg_hash_to_str(MSG_FAILED)
);
else else
snprintf(err_buf, sizeof(err_buf), "%s \"%s\".\n", snprintf(err_buf, sizeof(err_buf), "%s \"%s\".\n",
msg_hash_to_str(MSG_FAILED_TO_LOAD_STATE), msg_hash_to_str(MSG_FAILED_TO_LOAD_STATE),
@ -980,16 +987,16 @@ static void task_push_save_state(const char *path, void *data, size_t size, bool
goto error; goto error;
strlcpy(state->path, path, sizeof(state->path)); strlcpy(state->path, path, sizeof(state->path));
state->data = data; state->data = data;
state->size = size; state->size = size;
state->autosave = autosave; state->autosave = autosave;
state->mute = autosave; /* don't show OSD messages if we are auto-saving */ state->mute = autosave; /* don't show OSD messages if we are auto-saving */
task->type = TASK_TYPE_BLOCKING; task->type = TASK_TYPE_BLOCKING;
task->state = state; task->state = state;
task->handler = task_save_handler; task->handler = task_save_handler;
task->title = strdup(msg_hash_to_str(MSG_SAVING_STATE)); task->title = strdup(msg_hash_to_str(MSG_SAVING_STATE));
task->mute = state->mute; task->mute = state->mute;
task_queue_ctl(TASK_QUEUE_CTL_PUSH, task); task_queue_ctl(TASK_QUEUE_CTL_PUSH, task);
@ -1036,7 +1043,8 @@ static void content_load_and_save_state_cb(void *task_data,
* Create a new task to load current state first into a backup buffer (for undo) * Create a new task to load current state first into a backup buffer (for undo)
* and then save the content state. * and then save the content state.
**/ **/
static void task_push_load_and_save_state(const char *path, void *data, size_t size, bool load_to_backup_buffer, bool autosave) static void task_push_load_and_save_state(const char *path, void *data,
size_t size, bool load_to_backup_buffer, bool autosave)
{ {
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task)); retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
save_task_state_t *state = (save_task_state_t*)calloc(1, sizeof(*state)); save_task_state_t *state = (save_task_state_t*)calloc(1, sizeof(*state));
@ -1048,8 +1056,8 @@ static void task_push_load_and_save_state(const char *path, void *data, size_t s
state->load_to_backup_buffer = load_to_backup_buffer; state->load_to_backup_buffer = load_to_backup_buffer;
state->undo_size = size; state->undo_size = size;
state->undo_data = data; state->undo_data = data;
state->autosave = autosave; state->autosave = autosave;
state->mute = autosave; /* don't show OSD messages if we are auto-saving */ state->mute = autosave; /* don't show OSD messages if we are auto-saving */
task->state = state; task->state = state;
task->type = TASK_TYPE_BLOCKING; task->type = TASK_TYPE_BLOCKING;
@ -1172,7 +1180,8 @@ bool content_save_state(const char *path, bool save_to_disk, bool autosave)
* *
* *
**/ **/
bool content_load_state(const char *path, bool load_to_backup_buffer, bool autoload) bool content_load_state(const char *path,
bool load_to_backup_buffer, bool autoload)
{ {
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task)); retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
save_task_state_t *state = (save_task_state_t*)calloc(1, sizeof(*state)); save_task_state_t *state = (save_task_state_t*)calloc(1, sizeof(*state));
@ -1182,13 +1191,13 @@ bool content_load_state(const char *path, bool load_to_backup_buffer, bool autol
strlcpy(state->path, path, sizeof(state->path)); strlcpy(state->path, path, sizeof(state->path));
state->load_to_backup_buffer = load_to_backup_buffer; state->load_to_backup_buffer = load_to_backup_buffer;
state->autoload = autoload; state->autoload = autoload;
task->type = TASK_TYPE_BLOCKING; task->type = TASK_TYPE_BLOCKING;
task->state = state; task->state = state;
task->handler = task_load_handler; task->handler = task_load_handler;
task->callback = content_load_state_cb; task->callback = content_load_state_cb;
task->title = strdup(msg_hash_to_str(MSG_LOADING_STATE)); task->title = strdup(msg_hash_to_str(MSG_LOADING_STATE));
task_queue_ctl(TASK_QUEUE_CTL_PUSH, task); task_queue_ctl(TASK_QUEUE_CTL_PUSH, task);