comparison blastem.c @ 721:20be7d01e312

Better handling of savestate and debug break events with "uncooperative" games/demos
author Michael Pavone <pavone@retrodev.com>
date Wed, 20 May 2015 23:34:12 -0700
parents 019d27995e32
children 535e97bad27f
comparison
equal deleted inserted replaced
720:15d9359fd771 721:20be7d01e312
249 if (context->int_ack) { 249 if (context->int_ack) {
250 //printf("acknowledging %d @ %d:%d, vcounter: %d, hslot: %d\n", context->int_ack, context->current_cycle, v_context->cycles, v_context->vcounter, v_context->hslot); 250 //printf("acknowledging %d @ %d:%d, vcounter: %d, hslot: %d\n", context->int_ack, context->current_cycle, v_context->cycles, v_context->vcounter, v_context->hslot);
251 vdp_int_ack(v_context, context->int_ack); 251 vdp_int_ack(v_context, context->int_ack);
252 context->int_ack = 0; 252 context->int_ack = 0;
253 } 253 }
254 if (!address && (break_on_sync || save_state)) {
255 context->sync_cycle = context->current_cycle + 1;
256 }
254 adjust_int_cycle(context, v_context); 257 adjust_int_cycle(context, v_context);
255 if (address) { 258 if (address) {
256 if (break_on_sync) { 259 if (break_on_sync) {
257 break_on_sync = 0; 260 break_on_sync = 0;
258 debugger(context, address); 261 debugger(context, address);
263 while (!z_context->pc) 266 while (!z_context->pc)
264 { 267 {
265 sync_z80(z_context, z_context->current_cycle + MCLKS_PER_Z80); 268 sync_z80(z_context, z_context->current_cycle + MCLKS_PER_Z80);
266 } 269 }
267 save_gst(gen, "savestate.gst", address); 270 save_gst(gen, "savestate.gst", address);
271 puts("Saved state to savestate.gst");
268 } 272 }
269 } 273 }
270 return context; 274 return context;
271 } 275 }
272 276