summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Nathan Woods <npwoods@mess.org>2014-04-15 23:02:26 +0000
committer Nathan Woods <npwoods@mess.org>2014-04-15 23:02:26 +0000
commit2365ce7efba891fb1092f71b8ddf2e192664a889 (patch)
treea6639899ec177111120a8ea586fbe5f10b1f80f5 /src
parent64e1b14297420db75e5c6d869d9e4b9b04697a55 (diff)
Readding single step capability
Diffstat (limited to 'src')
-rw-r--r--src/emu/inpttype.h3
-rw-r--r--src/emu/ioport.h1
-rw-r--r--src/emu/ui/emenubar.c10
-rw-r--r--src/emu/ui/ui.c11
-rw-r--r--src/emu/ui/ui.h1
5 files changed, 25 insertions, 1 deletions
diff --git a/src/emu/inpttype.h b/src/emu/inpttype.h
index faa3ecc0937..e8013cd5bab 100644
--- a/src/emu/inpttype.h
+++ b/src/emu/inpttype.h
@@ -734,7 +734,8 @@ void construct_core_types_ui_shortcuts(simple_list<input_type_entry> &typelist)
{
INPUT_PORT_DIGITAL_TYPE( 0, UI_SHORTCUT, UI_ON_SCREEN_DISPLAY,"On Screen Display", input_seq(KEYCODE_TILDE) )
INPUT_PORT_DIGITAL_TYPE( 0, UI_SHORTCUT, UI_DEBUG_BREAK, "Break in Debugger", input_seq(KEYCODE_TILDE) )
- INPUT_PORT_DIGITAL_TYPE( 0, UI_SHORTCUT, UI_PAUSE, "Pause", input_seq(KEYCODE_P) )
+ INPUT_PORT_DIGITAL_TYPE( 0, UI_SHORTCUT, UI_PAUSE, "Pause", input_seq(KEYCODE_P, input_seq::not_code, KEYCODE_LSHIFT, input_seq::not_code, KEYCODE_RSHIFT ) )
+ INPUT_PORT_DIGITAL_TYPE( 0, UI_SHORTCUT, UI_SINGLE_STEP, "Single Step", input_seq(KEYCODE_P, KEYCODE_LSHIFT, input_seq::or_code, KEYCODE_P, KEYCODE_RSHIFT ) )
INPUT_PORT_DIGITAL_TYPE( 0, UI_SHORTCUT, UI_RESET_MACHINE, "Reset Game", input_seq(KEYCODE_F3, KEYCODE_LSHIFT) )
INPUT_PORT_DIGITAL_TYPE( 0, UI_SHORTCUT, UI_SOFT_RESET, "Soft Reset", input_seq(KEYCODE_F3, input_seq::not_code, KEYCODE_LSHIFT) )
INPUT_PORT_DIGITAL_TYPE( 0, UI_SHORTCUT, UI_EXIT, "Exit", input_seq(KEYCODE_ESC) )
diff --git a/src/emu/ioport.h b/src/emu/ioport.h
index f0b055773b2..e0363bad947 100644
--- a/src/emu/ioport.h
+++ b/src/emu/ioport.h
@@ -334,6 +334,7 @@ enum ioport_type
IPT_UI_ON_SCREEN_DISPLAY,
IPT_UI_DEBUG_BREAK,
IPT_UI_PAUSE,
+ IPT_UI_SINGLE_STEP,
IPT_UI_RESET_MACHINE,
IPT_UI_SOFT_RESET,
IPT_UI_SHOW_GFX,
diff --git a/src/emu/ui/emenubar.c b/src/emu/ui/emenubar.c
index 5be7c7a25e8..683df35fa2b 100644
--- a/src/emu/ui/emenubar.c
+++ b/src/emu/ui/emenubar.c
@@ -119,6 +119,13 @@ void ui_emu_menubar::menubar_draw_ui_elements()
machine().ui().draw_text_full(container(), text, 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL);
}
+ // if we're single-stepping, pause now
+ if (machine().ui().single_step())
+ {
+ machine().pause();
+ machine().ui().set_single_step(false);
+ }
+
// check for fast forward
if (machine().ioport().type_pressed(IPT_UI_FAST_FORWARD))
{
@@ -194,6 +201,9 @@ void ui_emu_menubar::build_file_menu()
menu_item &pause_menu = file_menu.append("Pause", &running_machine::toggle_pause, machine(), IPT_UI_PAUSE);
pause_menu.set_checked(machine().paused());
+ // single step
+ file_menu.append("Single Step", &ui_manager::do_single_step, machine().ui(), IPT_UI_PAUSE);
+
// reset
menu_item &reset_menu = file_menu.append("Reset");
reset_menu.append("Hard", &running_machine::schedule_hard_reset, machine(), IPT_UI_RESET_MACHINE);
diff --git a/src/emu/ui/ui.c b/src/emu/ui/ui.c
index 72d027eeb61..fc0e23a1110 100644
--- a/src/emu/ui/ui.c
+++ b/src/emu/ui/ui.c
@@ -1552,6 +1552,17 @@ void ui_manager::request_quit()
//-------------------------------------------------
+// do_single_step
+//-------------------------------------------------
+
+void ui_manager::do_single_step()
+{
+ set_single_step(true);
+ machine().resume();
+}
+
+
+//-------------------------------------------------
// handler_confirm_quit - leads the user through
// confirming quit emulation
//-------------------------------------------------
diff --git a/src/emu/ui/ui.h b/src/emu/ui/ui.h
index 42284cddb48..b666f050c77 100644
--- a/src/emu/ui/ui.h
+++ b/src/emu/ui/ui.h
@@ -170,6 +170,7 @@ public:
void increase_frameskip();
void decrease_frameskip();
void request_quit();
+ void do_single_step();
// UI handlers
static UINT32 ui_handler_load_save(running_machine &machine, render_container *container, UINT32 state);