diff --git a/configuration.h b/configuration.h index 5c8188790e..380a2ba8a8 100644 --- a/configuration.h +++ b/configuration.h @@ -42,6 +42,8 @@ RETRO_BEGIN_DECLS typedef struct settings { + bool modified; + video_viewport_t video_viewport_custom; char playlist_names[PATH_MAX_LENGTH]; @@ -495,6 +497,10 @@ typedef struct settings } settings_t; +#define configuration_set_int(settings, var, newvar) \ + settings->modified = true; \ + var = newvar + /** * config_get_default_camera: * diff --git a/runloop.c b/runloop.c index 71f500755b..caf7b5bcee 100644 --- a/runloop.c +++ b/runloop.c @@ -940,10 +940,11 @@ static enum runloop_state runloop_check_state( if (runloop_cmd_triggered(trigger_input, RARCH_STATE_SLOT_PLUS)) { char msg[128]; + int new_state_slot = settings->state_slot + 1; msg[0] = '\0'; - settings->state_slot++; + configuration_set_int(settings, settings->state_slot, new_state_slot); snprintf(msg, sizeof(msg), "%s: %d", msg_hash_to_str(MSG_STATE_SLOT), @@ -956,11 +957,14 @@ static enum runloop_state runloop_check_state( else if (runloop_cmd_triggered(trigger_input, RARCH_STATE_SLOT_MINUS)) { char msg[128]; + int new_state_slot = settings->state_slot - 1; msg[0] = '\0'; if (settings->state_slot > 0) - settings->state_slot--; + { + configuration_set_int(settings, settings->state_slot, new_state_slot); + } snprintf(msg, sizeof(msg), "%s: %d", msg_hash_to_str(MSG_STATE_SLOT),