diff menu.c @ 1015:6c54d5a5c7c0

Handle failures to load save state from the menu more gracefully
author Michael Pavone <pavone@retrodev.com>
date Mon, 02 May 2016 18:29:29 -0700
parents 51885857c019
children 5ebf6ddd5a44
line wrap: on
line diff
--- a/menu.c	Mon May 02 18:27:07 2016 -0700
+++ b/menu.c	Mon May 02 18:29:29 2016 -0700
@@ -301,6 +301,9 @@
 				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;