From 75a009ac400f52e4ff9371f7f2ea08fe7dc47e0a Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Tue, 24 Jun 2008 05:21:19 +0000 Subject: Do not stop in the debugger while we are waiting for a pending event to occur. This eliminates some confusion during reset and state loading. --- src/emu/debug/debugcpu.c | 2 +- src/emu/mame.c | 14 ++++++++++++++ src/emu/mame.h | 3 +++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c index d0ad7d3e977..039024c2728 100644 --- a/src/emu/debug/debugcpu.c +++ b/src/emu/debug/debugcpu.c @@ -844,7 +844,7 @@ void mame_debug_hook(offs_t curpc) } /* if we are supposed to halt, do it now */ - if (execution_state == EXECUTION_STATE_STOPPED) + if (execution_state == EXECUTION_STATE_STOPPED && !mame_is_scheduled_event_pending(Machine) && !mame_is_save_or_load_pending(Machine)) { /* reset the state */ steps_until_stop = 0; diff --git a/src/emu/mame.c b/src/emu/mame.c index 59080037c73..0edc32d73db 100644 --- a/src/emu/mame.c +++ b/src/emu/mame.c @@ -742,6 +742,20 @@ void mame_schedule_load(running_machine *machine, const char *filename) } +/*------------------------------------------------- + mame_is_save_or_load_pending - is a save or + load pending? +-------------------------------------------------*/ + +int mame_is_save_or_load_pending(running_machine *machine) +{ + /* we can't check for saveload_pending_file here because it will bypass */ + /* required UI screens if a state is queued from the command line */ + mame_private *mame = machine->mame_data; + return (mame->saveload_pending_file != NULL); +} + + /*------------------------------------------------- mame_is_scheduled_event_pending - is a scheduled event pending? diff --git a/src/emu/mame.h b/src/emu/mame.h index ba75430b4ec..33598c850a8 100644 --- a/src/emu/mame.h +++ b/src/emu/mame.h @@ -302,6 +302,9 @@ void mame_schedule_save(running_machine *machine, const char *filename); /* schedule a load */ void mame_schedule_load(running_machine *machine, const char *filename); +/* is a save or load pending? */ +int mame_is_save_or_load_pending(running_machine *machine); + /* is a scheduled event pending? */ int mame_is_scheduled_event_pending(running_machine *machine); -- cgit v1.2.3