From 5b2b37e775d719fc055ef5e8e59cf965a8049e11 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Wed, 9 Aug 2017 23:26:51 -0700 Subject: New savestates are working. New config file option for selecting format states will be saved in. Mostly complete, needs a little more work before release --- blastem.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'blastem.c') diff --git a/blastem.c b/blastem.c index 9a1b01c..1ab6e8b 100644 --- a/blastem.c +++ b/blastem.c @@ -37,6 +37,7 @@ int headless = 0; int exit_after = 0; int z80_enabled = 1; int frame_limit = 0; +uint8_t use_native_states = 1; tern_node * config; @@ -169,8 +170,11 @@ void setup_saves(system_media *media, rom_info *info, system_header *context) free(save_dir); save_dir = get_save_dir(media); } - //TODO: make quick save filename dependent on system type - parts[2] = "quicksave.gst"; + if (use_native_states || context->type != SYSTEM_GENESIS) { + parts[2] = "quicksave.state"; + } else { + parts[2] = "quicksave.gst"; + } free(save_state_path); save_state_path = alloc_concat_m(3, parts); context->save_dir = save_dir; @@ -417,6 +421,12 @@ int main(int argc, char ** argv) if (!current_system) { fatal_error("Failed to configure emulated machine for %s\n", romfname); } + char *state_format = tern_find_path(config, "ui\0state_format\0", TVAL_PTR).ptrval; + if (state_format && !strcmp(state_format, "gst")) { + use_native_states = 0; + } else if (state_format && strcmp(state_format, "native")) { + warning("%s is not a valid value for the ui.state_format setting. Valid values are gst and native\n", state_format); + } setup_saves(&cart, &info, current_system); update_title(info.name); if (menu) { -- cgit v1.2.3