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...
This commit is contained in:
etabeta78 2015-01-17 10:30:03 +01:00
parent da8c30dfe4
commit 840460c828
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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;