コード例 #1
0
ファイル: auditmenu.c プロジェクト: h0tw1r3/mewui
void ui_menu_audit::handle()
{
	process(UI_MENU_PROCESS_CUSTOM_ONLY);

	if (m_x == m_size)
	{
		process(UI_MENU_PROCESS_CUSTOM_ONLY);
		machine().ui().draw_text_box(container, "Audit in progress...", JUSTIFY_CENTER, 0.5f, 0.5f, UI_GREEN_COLOR);
		m_x = m_size - 1;
		return;
	}

	if (m_audit_mode == 1)
	{
		for (; m_x >= 0; --m_x)
		{
			driver_enumerator enumerator(machine().options(), m_unavailable[m_x]->name);
			enumerator.next();
			media_auditor auditor(enumerator);
			media_auditor::summary summary = auditor.audit_media(AUDIT_VALIDATE_FAST);

			// if everything looks good, include the driver
			if (summary == media_auditor::CORRECT || summary == media_auditor::BEST_AVAILABLE || summary == media_auditor::NONE_NEEDED)
			{
				m_available.push_back(m_unavailable[m_x]);
				m_unavailable.erase(m_unavailable.begin() + m_x);
			}
		}
	}
	else
	{
		for (; m_x >= 0; --m_x)
		{
			const game_driver *driver = &driver_list::driver(m_x);
			if (!strcmp("___empty", driver->name))
				continue;

			driver_enumerator enumerator(machine().options(), driver->name);
			enumerator.next();
			media_auditor auditor(enumerator);
			media_auditor::summary summary = auditor.audit_media(AUDIT_VALIDATE_FAST);

			// if everything looks good, include the driver
			if (summary == media_auditor::CORRECT || summary == media_auditor::BEST_AVAILABLE || summary == media_auditor::NONE_NEEDED)
				m_available.push_back(driver);
			else
				m_unavailable.push_back(driver);
		}
	}

	// sort
	m_availablesorted = m_available;
	std::stable_sort(m_availablesorted.begin(), m_availablesorted.end(), sorted_game_list);
	m_unavailablesorted = m_unavailable;
	std::stable_sort(m_unavailablesorted.begin(), m_unavailablesorted.end(), sorted_game_list);
	save_available_machines();
	ui_menu::menu_stack->parent->reset(UI_MENU_RESET_SELECT_FIRST);
	ui_menu::stack_pop(machine());
}
コード例 #2
0
ファイル: auditmenu.cpp プロジェクト: quinsmpang/mewui
void ui_menu_audit::handle()
{
	process(UI_MENU_PROCESS_CUSTOM_ONLY);

	if (m_first)
	{
		machine().ui().draw_text_box(container, "Audit in progress...", JUSTIFY_CENTER, 0.5f, 0.5f, UI_GREEN_COLOR);
		m_first = false;
		return;
	}

	if (m_audit_mode == 1)
	{
		std::vector<const game_driver *>::iterator iter = m_unavailablesorted.begin();
		while (iter != m_unavailablesorted.end())
		{
			driver_enumerator enumerator(machine().options(), (*iter)->name);
			enumerator.next();
			media_auditor auditor(enumerator);
			media_auditor::summary summary = auditor.audit_media(AUDIT_VALIDATE_FAST);

			// if everything looks good, include the driver
			if (summary == media_auditor::CORRECT || summary == media_auditor::BEST_AVAILABLE || summary == media_auditor::NONE_NEEDED)
			{
				m_availablesorted.push_back((*iter));
				iter = m_unavailablesorted.erase(iter);
			}
			else
				++iter;
		}
	}
	else
	{
		driver_enumerator enumerator(machine().options());
		media_auditor auditor(enumerator);
		while (enumerator.next())
		{
			media_auditor::summary summary = auditor.audit_media(AUDIT_VALIDATE_FAST);

			// if everything looks good, include the driver
			if (summary == media_auditor::CORRECT || summary == media_auditor::BEST_AVAILABLE || summary == media_auditor::NONE_NEEDED)
				m_availablesorted.push_back(&enumerator.driver());
			else
				m_unavailablesorted.push_back(&enumerator.driver());
		}
	}

	// sort
	std::stable_sort(m_availablesorted.begin(), m_availablesorted.end(), sorted_game_list);
	std::stable_sort(m_unavailablesorted.begin(), m_unavailablesorted.end(), sorted_game_list);
	save_available_machines();
	ui_menu::menu_stack->parent->reset(UI_MENU_RESET_SELECT_FIRST);
	ui_menu::stack_pop(machine());
}
コード例 #3
0
ファイル: selgame.c プロジェクト: mbcoguno/mame
void ui_menu_select_game::inkey_select(const ui_menu_event *menu_event)
{
	const game_driver *driver = (const game_driver *)menu_event->itemref;

	// special case for configure inputs
	if ((FPTR)driver == 1)
		ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_input_groups(machine(), container)));

	// anything else is a driver
	else
	{
		// audit the game first to see if we're going to work
		driver_enumerator enumerator(machine().options(), *driver);
		enumerator.next();
		media_auditor auditor(enumerator);
		media_auditor::summary summary = auditor.audit_media(AUDIT_VALIDATE_FAST);

		// if everything looks good, schedule the new driver
		if (summary == media_auditor::CORRECT || summary == media_auditor::BEST_AVAILABLE || summary == media_auditor::NONE_NEEDED)
		{
			machine().manager().schedule_new_driver(*driver);
			machine().schedule_hard_reset();
			ui_menu::stack_reset(machine());
		}

		// otherwise, display an error
		else
		{
			reset(UI_MENU_RESET_REMEMBER_REF);
			m_error = true;
		}
	}
}
コード例 #4
0
ファイル: imgcntrl.c プロジェクト: dinkc64/mame
void ui_menu_control_device_image::load_software_part()
{
	std::string temp_name = std::string(sld->list_name()).append(":").append(swi->shortname()).append(":").append(swp->name());

	driver_enumerator drivlist(machine().options(), machine().options().system_name());
	drivlist.next();
	media_auditor auditor(drivlist);
	media_auditor::summary summary = auditor.audit_software(sld->list_name(), (software_info *)swi, AUDIT_VALIDATE_FAST);
	// if everything looks good, load software
	if (summary == media_auditor::CORRECT || summary == media_auditor::BEST_AVAILABLE || summary == media_auditor::NONE_NEEDED)
		hook_load(temp_name, true);
	else
	{
		popmessage("The selected game is missing one or more required ROM or CHD images. Please select a different game.");
		state = SELECT_SOFTLIST;
	}
}
コード例 #5
0
ファイル: fragment_compute.hpp プロジェクト: ssteinberg/ste
	static auto create_compute_pipeline(const ste_context &ctx,
										const char *name,
										const pipeline_external_binding_set *external_binding_sets_collection,
										device_pipeline_shader_stage &shader_stage) {
		// Compute pipeline auditor
		pipeline_auditor_compute auditor(shader_stage);

		// Create pipeline
		auto obj = external_binding_sets_collection
					   ? auditor.pipeline(ctx,
										  std::ref(*external_binding_sets_collection),
										  name)
					   : auditor.pipeline(ctx,
										  name);

		return lib::allocate_unique<device_pipeline_compute>(std::move(obj));
	}
コード例 #6
0
ファイル: imgcntrl.cpp プロジェクト: RafTacker/mame
void menu_control_device_image::load_software_part()
{
	std::string temp_name = string_format("%s:%s:%s", m_sld->list_name(), m_swi->shortname(), m_swp->name());

	driver_enumerator drivlist(machine().options(), machine().options().system_name());
	drivlist.next();
	media_auditor auditor(drivlist);
	media_auditor::summary summary = auditor.audit_software(m_sld->list_name(), (software_info *)m_swi, AUDIT_VALIDATE_FAST);
	// if everything looks good, load software
	if (summary == media_auditor::CORRECT || summary == media_auditor::BEST_AVAILABLE || summary == media_auditor::NONE_NEEDED)
	{
		m_image.load_software(temp_name);
		stack_pop();
	}
	else
	{
		machine().popmessage(_("The software selected is missing one or more required ROM or CHD images. Please select a different one."));
		m_state = SELECT_SOFTLIST;
	}
}