Exemplo n.º 1
0
        // handlers

        //-------------------------------------------------
        //  handle select key event
        //-------------------------------------------------
        void inkey_select(event_ menu_event)
        {
            var system    = (ui_system_info)menu_event.itemref;
            int driverint = menu_event.itemref is int?(int)menu_event.itemref : -1;

            if (driverint == CONF_OPTS)
            {
                // special case for configure options

                throw new emu_unimplemented();
#if false
#endif
            }
            else if (driverint == CONF_MACHINE)
            {
                // special case for configure machine

                throw new emu_unimplemented();
#if false
#endif
            }
            else
            {
                // anything else is a driver

                driver_enumerator enumerator = new driver_enumerator(machine().options(), system.driver);
                enumerator.next();

                // if there are software entries, show a software selection menu
                foreach (software_list_device swlistdev in new software_list_device_enumerator(enumerator.config().root_device()))
                {
                    if (!swlistdev.get_info().empty())
                    {
                        throw new emu_unimplemented();
#if false
#endif
                    }
                }

                // audit the system ROMs first to see if we're going to work
                media_auditor         auditor = new media_auditor(enumerator);
                media_auditor.summary summary = auditor.audit_media(media_auditor.AUDIT_VALIDATE_FAST);


                // MCS - always pass audit
                //throw new emu_unimplemented();
                summary = media_auditor.summary.CORRECT;


                // if everything looks good, schedule the new driver
                if (audit_passed(summary))
                {
                    if (!select_bios(system.driver, false))
                    {
                        launch_system(system.driver);
                    }
                }
                else
                {
                    // otherwise, display an error
                    set_error(reset_options.REMEMBER_REF, make_system_audit_fail_text(auditor, summary));
                }
            }
        }
Exemplo n.º 2
0
        //-------------------------------------------------
        //  handle select key event for favorites menu
        //-------------------------------------------------
        void inkey_select_favorite(event_ menu_event)
        {
            ui_software_info ui_swinfo = (ui_software_info)menu_event.itemref;
            int ui_swinfoint           = (int)menu_event.itemref;

            if (ui_swinfoint == CONF_OPTS)
            {
                throw new emu_unimplemented();
#if false
#endif
            }
            else if (ui_swinfoint == CONF_MACHINE)
            {
                // special case for configure machine
                if (m_prev_selected != null)
                {
                    ui_software_info swinfo = (ui_software_info)m_prev_selected;

                    throw new emu_unimplemented();
#if false
#endif
                }
                return;
            }
            else if (ui_swinfo.startempty == 1)
            {
                driver_enumerator enumerator = new driver_enumerator(machine().options(), ui_swinfo.driver);
                enumerator.next();

                // if there are software entries, show a software selection menu
                foreach (software_list_device swlistdev in new software_list_device_enumerator(enumerator.config().root_device()))
                {
                    if (!swlistdev.get_info().empty())
                    {
                        throw new emu_unimplemented();
#if false
#endif
                    }
                }

                // audit the system ROMs first to see if we're going to work
                media_auditor         auditor = new media_auditor(enumerator);
                media_auditor.summary summary = auditor.audit_media(media_auditor.AUDIT_VALIDATE_FAST);

                if (audit_passed(summary))
                {
                    // if everything looks good, schedule the new driver
                    if (!select_bios(ui_swinfo.driver, false))
                    {
                        reselect_last.reselect(true);
                        launch_system(ui_swinfo.driver);
                    }
                }
                else
                {
                    // otherwise, display an error
                    set_error(reset_options.REMEMBER_REF, make_system_audit_fail_text(auditor, summary));
                }
            }
            else
            {
                // first audit the system ROMs
                driver_enumerator drv     = new driver_enumerator(machine().options(), ui_swinfo.driver);
                media_auditor     auditor = new media_auditor(drv);
                drv.next();

                media_auditor.summary sysaudit = auditor.audit_media(media_auditor.AUDIT_VALIDATE_FAST);
                if (!audit_passed(sysaudit))
                {
                    set_error(reset_options.REMEMBER_REF, make_system_audit_fail_text(auditor, sysaudit));
                }
                else
                {
                    // now audit the software
                    software_list_device swlist = software_list_device.find_by_name(drv.config(), ui_swinfo.listname);
                    software_info        swinfo = swlist.find(ui_swinfo.shortname);

                    media_auditor.summary swaudit = auditor.audit_software(swlist, swinfo, media_auditor.AUDIT_VALIDATE_FAST);

                    if (audit_passed(swaudit))
                    {
                        throw new emu_unimplemented();
#if false
#endif
                    }
                    else
                    {
                        // otherwise, display an error
                        set_error(reset_options.REMEMBER_REF, make_software_audit_fail_text(auditor, swaudit));
                    }
                }
            }
        }