diff options
Diffstat (limited to 'src/emu/machine.cpp')
-rw-r--r-- | src/emu/machine.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp index d76ad49676d..70d1ccc411b 100644 --- a/src/emu/machine.cpp +++ b/src/emu/machine.cpp @@ -739,12 +739,15 @@ void running_machine::toggle_pause() // given type //------------------------------------------------- -void running_machine::add_notifier(machine_notification event, machine_notify_delegate callback) +void running_machine::add_notifier(machine_notification event, machine_notify_delegate callback, bool first) { assert_always(m_current_phase == MACHINE_PHASE_INIT, "Can only call add_notifier at init time!"); + if(first) + m_notifier_list[event].push_front(std::make_unique<notifier_callback_item>(callback)); + // exit notifiers are added to the head, and executed in reverse order - if (event == MACHINE_NOTIFY_EXIT) + else if (event == MACHINE_NOTIFY_EXIT) m_notifier_list[event].push_front(std::make_unique<notifier_callback_item>(callback)); // all other notifiers are added to the tail, and executed in the order registered |