diff options
author | Michael Pavone <pavone@retrodev.com> | 2017-08-09 23:26:51 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2017-08-09 23:26:51 -0700 |
commit | 5b2b37e775d719fc055ef5e8e59cf965a8049e11 (patch) | |
tree | 4662dab8115571aaced5ee6e2d1c80cc7839f3be /menu.c | |
parent | 581601741c3b94bc66a03eece1774618312b260a (diff) |
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
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -429,11 +429,20 @@ void * menu_write_w(uint32_t address, void * context, uint16_t value) slotname = numslotname; } char const *parts[] = {gen->header.next_context->save_dir, PATH_SEP, slotname}; - char *gstpath = alloc_concat_m(3, parts); + char *statepath = alloc_concat_m(3, parts); genesis_context *next = (genesis_context *)gen->header.next_context; - - uint32_t pc = load_gst(next, gstpath); - free(gstpath); + deserialize_buffer state; + uint32_t pc = 0; + if (load_from_file(&state, statepath)) { + genesis_deserialize(&state, next); + free(state.data); + //HACK + pc = next->m68k->last_prefetch_address; + } else { + strcpy(statepath + strlen(statepath)-strlen("state"), "gst"); + pc = load_gst(next, statepath); + } + free(statepath); if (!pc) { break; } |