Beispiel #1
0
        public override void create_custom(running_machine machine)
        {
            // start the inifile manager
            m_inifile = new inifile_manager(m_ui.options());

            // allocate autoboot timer
            m_autoboot_timer = machine.scheduler().timer_alloc(autoboot_callback);

            // start favorite manager
            m_favorite = new favorite_manager(m_ui.options());
        }
Beispiel #2
0
        //-------------------------------------------------
        //  ctor
        //-------------------------------------------------
        menu_select_game(mame_ui_manager mui, render_container container, string gamename)
            : base(mui, container, false)
        {
            m_persistent_data     = system_list.instance();
            m_icons               = new icon_cache(MAX_ICONS_RENDER);
            m_icon_paths          = "";
            m_displaylist         = new std.vector <ui_system_info>();
            m_searchlist          = new std.vector <std.pair <double, ui_system_info> >();
            m_searched_fields     = (unsigned)system_list.available.AVAIL_NONE;
            m_populated_favorites = false;


            string     error_string;
            string     last_filter;
            ui_options moptions = mui.options();

            // load drivers cache
            m_persistent_data.cache_data(mui.options());

            // check if there are available system icons
            check_for_icons(null);

            // build drivers list
            if (!load_available_machines())
            {
                build_available_list();
            }

            if (s_first_start)
            {
                //s_first_start = false; TODO: why wasn't it ever clearing the first start flag?

                reselect_last.set_driver(moptions.last_used_machine());
                ui_globals.rpanel = (uint8_t)std.min(std.max(moptions.last_right_panel(), (int)RP_FIRST), (int)RP_LAST);

                string tmp   = moptions.last_used_filter();
                size_t found = tmp.find_first_of(',');
                string fake_ini;
                if (found == npos)
                {
                    fake_ini = util.string_format("\uFEFF{0} = 1\n", tmp);
                }
                else
                {
                    string sub_filter = tmp.substr(found + 1);
                    tmp      = tmp.Substring((int)found); // .resize(found);
                    fake_ini = util.string_format("\uFEFF{0} = {1}\n", tmp, sub_filter);
                }

                emu_file file = new emu_file(ui().options().ui_path(), OPEN_FLAG_READ);

                MemoryU8 fake_ini_buffer = new MemoryU8(System.Text.Encoding.ASCII.GetBytes(fake_ini));
                if (!file.open_ram(fake_ini_buffer, (u32)fake_ini.size()))  //if (!file.open_ram(fake_ini.c_str(), fake_ini.size()))
                {
                    m_persistent_data.filter_data().load_ini(file);
                    file.close();
                }
            }

            // do this after processing the last used filter setting so it overwrites the placeholder
            load_custom_filters();
            m_filter_highlight = (int)m_persistent_data.filter_data().get_current_filter_type();

            if (!moptions.remember_last())
            {
                reselect_last.reset();
            }

            mui.machine().options().set_value(OPTION_SNAPNAME, "%g/%i", OPTION_PRIORITY_CMDLINE);

            ui_globals.curdats_view  = 0;
            ui_globals.panels_status = (uint16_t)moptions.hide_panels();
            ui_globals.curdats_total = 1;
        }