From 840460c828a0ed8601798c8817f4349663211105 Mon Sep 17 00:00:00 2001 From: etabeta78 Date: Sat, 17 Jan 2015 10:30:03 +0100 Subject: [PATCH] ui: fixed bug where slot options set via internal UI did not properly create their sub-options. [Fabio Priuli] out of whatsnew: to see the bug, try to manually set from the UI "com" in a PC ISA port or "multitap" in the SMS driver in an old build, then reset (to apply changes) and re-enter the Slot Options menu just to see that the sub-options (the com serial ports and the multitap joypads) are not configurable because the core was not "informed" of their addition. no bug was present if the options were set from command line or from QMC2, so it was not so easy to spot the issue... --- src/emu/emuopts.h | 3 ++- src/emu/ui/slotopt.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/emu/emuopts.h b/src/emu/emuopts.h index 3b9f4d94aba..880a51a2d09 100644 --- a/src/emu/emuopts.h +++ b/src/emu/emuopts.h @@ -354,10 +354,11 @@ public: const char *main_value(astring &buffer, const char *option) const; const char *sub_value(astring &buffer, const char *name, const char *subname) const; + bool add_slot_options(bool isfirst); + private: // device-specific option handling void add_device_options(bool isfirst); - bool add_slot_options(bool isfirst); void update_slot_options(); // INI parsing helper diff --git a/src/emu/ui/slotopt.c b/src/emu/ui/slotopt.c index 3347baca00a..04e9b1fafa4 100644 --- a/src/emu/ui/slotopt.c +++ b/src/emu/ui/slotopt.c @@ -188,7 +188,10 @@ void ui_menu_slot_devices::handle() if (menu_event != NULL && menu_event->itemref != NULL) { if ((FPTR)menu_event->itemref == 1 && menu_event->iptkey == IPT_UI_SELECT) + { + machine().options().add_slot_options(false); machine().schedule_hard_reset(); + } else if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) { device_slot_interface *slot = (device_slot_interface *)menu_event->itemref;