summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/ui/ui.cpp
diff options
context:
space:
mode:
author Michele Fochi <michele.fochi@gmail.com>2016-02-13 20:41:19 +0100
committer Michele Fochi <michele.fochi@gmail.com>2016-02-13 21:03:16 +0100
commit00aec891925e530ced84f63a04aefaf0a4631582 (patch)
tree91674566f3cc38341573b90a766b91056fad7694 /src/emu/ui/ui.cpp
parente49253b0e0cfde7975a2f14190c1e5ad3a339d16 (diff)
Added support for autofire under cheat menu and available only if cheats
activated.
Diffstat (limited to 'src/emu/ui/ui.cpp')
-rw-r--r--src/emu/ui/ui.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/emu/ui/ui.cpp b/src/emu/ui/ui.cpp
index c92e700b433..38bfea64fd9 100644
--- a/src/emu/ui/ui.cpp
+++ b/src/emu/ui/ui.cpp
@@ -1769,6 +1769,21 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co
if (machine.ui_input().pressed(IPT_UI_THROTTLE))
machine.video().toggle_throttle();
+ // toggle autofire
+ if (machine.ui_input().pressed(IPT_UI_TOGGLE_AUTOFIRE))
+ {
+ if (!machine.options().cheat())
+ {
+ machine.popmessage("Autofire can't be enabled");
+ }
+ else
+ {
+ bool autofire_toggle = machine.ioport().get_autofire_toggle();
+ machine.ioport().set_autofire_toggle(!autofire_toggle);
+ machine.popmessage("Autofire %s", autofire_toggle ? "Disabled" : "Enabled");
+ }
+ }
+
// check for fast forward
if (machine.ioport().type_pressed(IPT_UI_FAST_FORWARD))
{