summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2016-05-02 18:29:29 -0700
committerMichael Pavone <pavone@retrodev.com>2016-05-02 18:29:29 -0700
commit2a38f79ded7f040c2f8b1b9cccdfca7d970530df (patch)
tree45550079e7c5b23df534aef93476a9779bfd328c /menu.c
parent817ce6db7cbf7ef33095011077644feade624e11 (diff)
Handle failures to load save state from the menu more gracefully
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/menu.c b/menu.c
index 052ed19..6d8786e 100644
--- a/menu.c
+++ b/menu.c
@@ -301,6 +301,9 @@ void * menu_write_w(uint32_t address, void * context, uint16_t value)
char *gstpath = alloc_concat_m(3, parts);
uint32_t pc = load_gst(gen->next_context, gstpath);
free(gstpath);
+ if (!pc) {
+ break;
+ }
gen->next_context->m68k->resume_pc = get_native_address_trans(gen->next_context->m68k, pc);
}
m68k->should_return = 1;