• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ osd_printf_warning函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中osd_printf_warning函数的典型用法代码示例。如果您正苦于以下问题:C++ osd_printf_warning函数的具体用法?C++ osd_printf_warning怎么用?C++ osd_printf_warning使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了osd_printf_warning函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: switch

void timer_device::device_validity_check(validity_checker &valid) const
{
	// type based configuration
	switch (m_type)
	{
		case TIMER_TYPE_GENERIC:
			if (m_screen_tag != nullptr || m_first_vpos != 0 || m_start_delay != attotime::zero)
				osd_printf_warning("Generic timer specified parameters for a scanline timer\n");
			if (m_period != attotime::zero || m_start_delay != attotime::zero)
				osd_printf_warning("Generic timer specified parameters for a periodic timer\n");
			break;

		case TIMER_TYPE_PERIODIC:
			if (m_screen_tag != nullptr || m_first_vpos != 0)
				osd_printf_warning("Periodic timer specified parameters for a scanline timer\n");
			if (m_period <= attotime::zero)
				osd_printf_error("Periodic timer specified invalid period\n");
			break;

		case TIMER_TYPE_SCANLINE:
			if (m_period != attotime::zero || m_start_delay != attotime::zero)
				osd_printf_warning("Scanline timer specified parameters for a periodic timer\n");
			if (m_param != 0)
				osd_printf_warning("Scanline timer specified parameter which is ignored\n");
//          if (m_first_vpos < 0)
//              osd_printf_error("Scanline timer specified invalid initial position\n");
//          if (m_increment < 0)
//              osd_printf_error("Scanline timer specified invalid increment\n");
			break;

		default:
			osd_printf_error("Invalid type specified\n");
			break;
	}
}
开发者ID:system11b,项目名称:mame,代码行数:35,代码来源:timer.cpp


示例2: region

void *finder_base::find_memregion(u8 width, size_t &length, bool required) const
{
	// look up the region and return nullptr if not found
	memory_region *const region(m_base.get().memregion(m_tag));
	if (!region)
	{
		length = 0;
		return nullptr;
	}

	// check the width and warn if not correct
	if (region->bytewidth() != width)
	{
		if (required)
			osd_printf_warning("Region '%s' found but is width %d, not %d as requested\n", m_tag, region->bitwidth(), width*8);
		length = 0;
		return nullptr;
	}

	// check the length and warn if other than specified
	size_t const length_found = region->bytes() / width;
	if (length != 0 && length != length_found)
	{
		if (required)
			osd_printf_warning("Region '%s' found but has %d bytes, not %ld as requested\n", m_tag, region->bytes(), long(length*width));
		length = 0;
		return nullptr;
	}

	// return results
	length = length_found;
	return region->base();
}
开发者ID:RafTacker,项目名称:mame,代码行数:33,代码来源:devfind.cpp


示例3: m_next

address_map_entry::address_map_entry(device_t &device, address_map &map, offs_t start, offs_t end)
	: m_next(nullptr),
		m_map(map),
		m_devbase(device),
		m_addrstart(start),
		m_addrend(end),
		m_addrmirror(0),
		m_addrmask(0),
		m_addrselect(0),
		m_share(nullptr),
		m_region(nullptr),
		m_rgnoffs(0),
		m_submap_bits(0),
		m_memory(nullptr),
		m_bytestart(0),
		m_byteend(0),
		m_bytemirror(0),
		m_bytemask(0)
{
	if (map.m_globalmask != 0 && (start & ~map.m_globalmask) != 0)
	{
		osd_printf_warning("AS_%d map entry start %08X lies outside global address mask %08X\n", map.m_spacenum, start, map.m_globalmask);
		m_addrstart &= map.m_globalmask;
	}

	if (map.m_globalmask != 0 && (end & ~map.m_globalmask) != 0)
	{
		osd_printf_warning("AS_%d map entry end %08X lies outside global address mask %08X\n", map.m_spacenum, end, map.m_globalmask);
		m_addrend &= map.m_globalmask;
	}
}
开发者ID:Robbbert,项目名称:store1,代码行数:31,代码来源:addrmap.cpp


示例4: catch

void cheat_script::script_entry::execute(cheat_manager &manager, uint64_t &argindex)
{
	// evaluate the condition
	if (!m_condition.is_empty())
	{
		try
		{
			uint64_t result = m_condition.execute();
			if (result == 0)
				return;
		}
		catch (expression_error &err)
		{
			osd_printf_warning("Error executing conditional expression \"%s\": %s\n", m_condition.original_string(), err.code_string());
			return;
		}
	}

	// if there is an action, execute it
	if (!m_expression.is_empty())
	{
		try
		{
			m_expression.execute();
		}
		catch (expression_error &err)
		{
			osd_printf_warning("Error executing expression \"%s\": %s\n", m_expression.original_string(), err.code_string());
		}
	}

	// if there is a string to display, compute it
	if (!m_format.empty())
	{
		// iterate over arguments and evaluate them
		uint64_t params[MAX_ARGUMENTS];
		int curarg = 0;
		for (auto &arg : m_arglist)
			curarg += arg->values(argindex, &params[curarg]);

		// generate the astring
		manager.get_output_string(m_line, m_justify) = string_format(m_format,
			(uint32_t)params[0],  (uint32_t)params[1],  (uint32_t)params[2],  (uint32_t)params[3],
			(uint32_t)params[4],  (uint32_t)params[5],  (uint32_t)params[6],  (uint32_t)params[7],
			(uint32_t)params[8],  (uint32_t)params[9],  (uint32_t)params[10], (uint32_t)params[11],
			(uint32_t)params[12], (uint32_t)params[13], (uint32_t)params[14], (uint32_t)params[15],
			(uint32_t)params[16], (uint32_t)params[17], (uint32_t)params[18], (uint32_t)params[19],
			(uint32_t)params[20], (uint32_t)params[21], (uint32_t)params[22], (uint32_t)params[23],
			(uint32_t)params[24], (uint32_t)params[25], (uint32_t)params[26], (uint32_t)params[27],
			(uint32_t)params[28], (uint32_t)params[29], (uint32_t)params[30], (uint32_t)params[31]);
	}
}
开发者ID:crazii,项目名称:mameui,代码行数:52,代码来源:cheat.cpp


示例5: catch

void cheat_script::script_entry::execute(cheat_manager &manager, UINT64 &argindex)
{
	// evaluate the condition
	if (!m_condition.is_empty())
	{
		try
		{
			UINT64 result = m_condition.execute();
			if (result == 0)
				return;
		}
		catch (expression_error &err)
		{
			osd_printf_warning("Error executing conditional expression \"%s\": %s\n", m_condition.original_string(), err.code_string());
			return;
		}
	}

	// if there is an action, execute it
	if (!m_expression.is_empty())
	{
		try
		{
			m_expression.execute();
		}
		catch (expression_error &err)
		{
			osd_printf_warning("Error executing expression \"%s\": %s\n", m_expression.original_string(), err.code_string());
		}
	}

	// if there is a string to display, compute it
	if (!m_format.empty())
	{
		// iterate over arguments and evaluate them
		UINT64 params[MAX_ARGUMENTS];
		int curarg = 0;
		for (output_argument *arg = m_arglist.first(); arg != nullptr; arg = arg->next())
			curarg += arg->values(argindex, &params[curarg]);

		// generate the astring
		strprintf(manager.get_output_astring(m_line, m_justify), m_format.c_str(),
			(UINT32)params[0],  (UINT32)params[1],  (UINT32)params[2],  (UINT32)params[3],
			(UINT32)params[4],  (UINT32)params[5],  (UINT32)params[6],  (UINT32)params[7],
			(UINT32)params[8],  (UINT32)params[9],  (UINT32)params[10], (UINT32)params[11],
			(UINT32)params[12], (UINT32)params[13], (UINT32)params[14], (UINT32)params[15],
			(UINT32)params[16], (UINT32)params[17], (UINT32)params[18], (UINT32)params[19],
			(UINT32)params[20], (UINT32)params[21], (UINT32)params[22], (UINT32)params[23],
			(UINT32)params[24], (UINT32)params[25], (UINT32)params[26], (UINT32)params[27],
			(UINT32)params[28], (UINT32)params[29], (UINT32)params[30], (UINT32)params[31]);
	}
}
开发者ID:gregdickhudl,项目名称:mame,代码行数:52,代码来源:cheat.cpp


示例6: m_state

cheat_script::cheat_script(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node const &scriptnode)
	: m_state(SCRIPT_STATE_RUN)
{
	// read the core attributes
	const char *state = scriptnode.get_attribute_string("state", "run");
	if (strcmp(state, "on") == 0)
		m_state = SCRIPT_STATE_ON;
	else if (strcmp(state, "off") == 0)
		m_state = SCRIPT_STATE_OFF;
	else if (strcmp(state, "change") == 0)
		m_state = SCRIPT_STATE_CHANGE;
	else if (strcmp(state, "run") != 0)
		throw emu_fatalerror("%s.xml(%d): invalid script state '%s'\n", filename, scriptnode.line, state);

	// iterate over nodes within the script
	for (xml_data_node const *entrynode = scriptnode.get_first_child(); entrynode != nullptr; entrynode = entrynode->get_next_sibling())
	{
		// handle action nodes
		if (strcmp(entrynode->get_name(), "action") == 0)
			m_entrylist.push_back(std::make_unique<script_entry>(manager, symbols, filename, *entrynode, true));

		// handle output nodes
		else if (strcmp(entrynode->get_name(), "output") == 0)
			m_entrylist.push_back(std::make_unique<script_entry>(manager, symbols, filename, *entrynode, false));

		// anything else is ignored
		else
		{
			osd_printf_warning("%s.xml(%d): unknown script item '%s' will be lost if saved\n", filename, entrynode->line, entrynode->get_name());
			continue;
		}
	}
}
开发者ID:crazii,项目名称:mameui,代码行数:33,代码来源:cheat.cpp


示例7: m_state

cheat_script::cheat_script(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node &scriptnode)
	: m_state(SCRIPT_STATE_RUN)
{
	// read the core attributes
	const char *state = xml_get_attribute_string(&scriptnode, "state", "run");
	if (strcmp(state, "on") == 0)
		m_state = SCRIPT_STATE_ON;
	else if (strcmp(state, "off") == 0)
		m_state = SCRIPT_STATE_OFF;
	else if (strcmp(state, "change") == 0)
		m_state = SCRIPT_STATE_CHANGE;
	else if (strcmp(state, "run") != 0)
		throw emu_fatalerror("%s.xml(%d): invalid script state '%s'\n", filename, scriptnode.line, state);

	// iterate over nodes within the script
	for (xml_data_node *entrynode = scriptnode.child; entrynode != NULL; entrynode = entrynode->next)
	{
		// handle action nodes
		if (strcmp(entrynode->name, "action") == 0)
			m_entrylist.append(*global_alloc(script_entry(manager, symbols, filename, *entrynode, true)));

		// handle output nodes
		else if (strcmp(entrynode->name, "output") == 0)
			m_entrylist.append(*global_alloc(script_entry(manager, symbols, filename, *entrynode, false)));

		// anything else is ignored
		else
		{
			osd_printf_warning("%s.xml(%d): unknown script item '%s' will be lost if saved\n", filename, entrynode->line, entrynode->name);
			continue;
		}
	}
}
开发者ID:dientaufan,项目名称:mame,代码行数:33,代码来源:cheat.c


示例8: region_fulltag

bool finder_base::validate_memregion(size_t bytes, bool required) const
{
	// make sure we can resolve the full path to the region
	size_t bytes_found = 0;
	std::string const region_fulltag(m_base.get().subtag(m_tag));

	// look for the region
	for (device_t const &dev : device_iterator(m_base.get().mconfig().root_device()))
	{
		for (romload::region const &region : romload::entries(dev.rom_region()).get_regions())
		{
			if (dev.subtag(region.get_tag()) == region_fulltag)
			{
				bytes_found = region.get_length();
				break;
			}
		}
		if (bytes_found != 0)
			break;
	}

	// check the length and warn if other than specified
	if ((bytes_found != 0) && (bytes != 0) && (bytes != bytes_found))
	{
		osd_printf_warning("Region '%s' found but has %ld bytes, not %ld as requested\n", m_tag, long(bytes_found), long(bytes));
		bytes_found = 0;
	}

	return report_missing(bytes_found != 0, "memory region", required);
}
开发者ID:RafTacker,项目名称:mame,代码行数:30,代码来源:devfind.cpp


示例9: uv_buf_init

void tcp_connection::write(const uint8_t* data, size_t len)
{
	if (m_is_closing)
		return;

	if (len == 0)
		return;

	uv_buf_t buffer;
	int written;
	int err;

	// First try uv_try_write(). In case it can not directly write all the given
	// data then build a uv_req_t and use uv_write().

	buffer = uv_buf_init((char*)data, len);
	written = uv_try_write((uv_stream_t*)m_uv_handle, &buffer, 1);

	// All the data was written. Done.
	if (written == (int)len)
	{
		return;
	}
	// Cannot write any data at first time. Use uv_write().
	else if (written == UV_EAGAIN || written == UV_ENOSYS)
	{
		// Set written to 0 so pending_len can be properly calculated.
		written = 0;
	}
	// Error. Should not happen.
	else if (written < 0)
	{
		osd_printf_warning("uv_try_write() failed, closing the connection: %s\n", uv_strerror(written));

		close();
		return;
	}

	// osd_printf_info("could just write %zu bytes (%zu given) at first time, using uv_write() now", (size_t)written, len);

	size_t pending_len = len - written;

	// Allocate a special UvWriteData struct pointer.
	tcp_uv_write_data* write_data = (tcp_uv_write_data*)std::malloc(sizeof(tcp_uv_write_data) + pending_len);

	write_data->connection = this;
	std::memcpy(write_data->store, data + written, pending_len);
	write_data->req.data = (void*)write_data;

	buffer = uv_buf_init((char*)write_data->store, pending_len);

	err = uv_write(&write_data->req, (uv_stream_t*)m_uv_handle, &buffer, 1, (uv_write_cb)on_write);
	if (err)
		throw emu_fatalerror("uv_write() failed: %s", uv_strerror(err));
}
开发者ID:bradhugh,项目名称:mame,代码行数:55,代码来源:tcp_connection.cpp


示例10: va_start

void finder_base::printf_warning(const char *format, ...)
{
	va_list argptr;
	char buffer[1024];

	/* do the output */
	va_start(argptr, format);
	vsnprintf(buffer, 1024, format, argptr);
	osd_printf_warning("%s", buffer);
	va_end(argptr);
}
开发者ID:RafTacker,项目名称:mame,代码行数:11,代码来源:devfind.cpp


示例11: osd_printf_warning

bool osd_interface::sound_init()
{
	osd_sound_type sound = m_sound_options.find(machine().options().sound());
	if (sound==NULL)
	{
		osd_printf_warning("sound_init: option %s not found switching to auto\n",machine().options().sound());
		sound = m_sound_options.find("auto");
	}
	m_sound = (*sound)(*this);
	return true;
}
开发者ID:Archlogic,项目名称:libretro-mame,代码行数:11,代码来源:osdepend.c


示例12: sdlwindow_sync

static void sdlwindow_sync(void)
{
	if (multithreading_enabled)
	{
		// Fallback
		while (!osd_work_queue_wait(work_queue, osd_ticks_per_second()*10))
		{
			osd_printf_warning("sdlwindow_sync: Sleeping...\n");
			osd_sleep(100000);
		}
	}
}
开发者ID:gregdickhudl,项目名称:mame,代码行数:12,代码来源:window.cpp


示例13: gl_check_error

int gl_check_error(GLSLCheckMode m, const char *file, const int line)
{
		GLenum glerr = glGetError();

		if (GL_NO_ERROR != glerr)
		{
				if ( CHECK_VERBOSE <= m )
				{
			osd_printf_warning( "%s:%d: GL Error: %d 0x%X\n", file, line, (int)glerr, (unsigned int)glerr);
				}
		}
	return (GL_NO_ERROR != glerr)? glerr : 0;
}
开发者ID:dinkc64,项目名称:mame,代码行数:13,代码来源:gl_shader_tool.c


示例14: find_software_item

bool device_image_interface::load_software_part(const char *path, software_part *&swpart)
{
	// if no match has been found, we suggest similar shortnames
	swpart = find_software_item(path, true);
	if (swpart == NULL)
	{
		software_list_device::display_matches(device().machine().config(), image_interface(), path);
		return false;
	}

	// Load the software part
	bool result = call_softlist_load(swpart->info().list(), swpart->info().shortname(), swpart->romdata());

	// Tell the world which part we actually loaded
	astring full_sw_name;
	full_sw_name.printf("%s:%s:%s", swpart->info().list().list_name(), swpart->info().shortname(), swpart->name());

	// check compatibility
	if (!swpart->is_compatible(swpart->info().list()))
		osd_printf_warning("WARNING! the set %s might not work on this system due to missing filter(s) '%s'\n", swpart->info().shortname(), swpart->info().list().filter());

	// check requirements and load those images
	const char *requirement = swpart->feature("requirement");
	if (requirement != NULL)
	{
		software_part *req_swpart = find_software_item(requirement, false);
		if (req_swpart != NULL)
		{
			image_interface_iterator imgiter(device().machine().root_device());
			for (device_image_interface *req_image = imgiter.first(); req_image != NULL; req_image = imgiter.next())
			{
				const char *interface = req_image->image_interface();
				if (interface != NULL)
				{
					if (req_swpart->matches_interface(interface))
					{
						const char *option = device().mconfig().options().value(req_image->brief_instance_name());
						// mount only if not already mounted
						if (strlen(option) == 0 && !req_image->filename())
						{
							req_image->set_init_phase();
							req_image->load(requirement);
						}
						break;
					}
				}
			}
		}
	}
	return result;
}
开发者ID:Eduardop,项目名称:mame,代码行数:51,代码来源:diimage.c


示例15: assert

device_t *machine_config::device_replace(device_t *owner, const char *tag, device_type type, UINT32 clock)
{
	// find the original device by this name (must exist)
	assert(owner != NULL);
	device_t *device = owner->subdevice(tag);
	if (device == NULL)
	{
		osd_printf_warning("Warning: attempting to replace non-existent device '%s'\n", tag);
		return device_add(owner, tag, type, clock);
	}

	// let the device's owner do the work
	return device->owner()->replace_subdevice(*device, type, tag, clock);
}
开发者ID:relimited,项目名称:mame,代码行数:14,代码来源:mconfig.c


示例16: owner

std::tuple<const char *, device_t *, device_t *> machine_config::prepare_replace(const char *tag)
{
	// make sure we have the old device's actual owner
	std::pair<const char *, device_t *> const owner(resolve_owner(tag));
	assert(owner.second);

	// remove references to the old device
	device_t *const old_device(owner.second->subdevice(owner.first));
	if (old_device)
		remove_references(*old_device);
	else
		osd_printf_warning("Warning: attempting to replace non-existent device '%s'\n", tag);

	return std::make_tuple(owner.first, owner.second, old_device);
}
开发者ID:MASHinfo,项目名称:mame,代码行数:15,代码来源:mconfig.cpp


示例17: map_blendmode

static inline SDL_BlendMode map_blendmode(const int blendmode)
{
	switch (blendmode)
	{
		case BLENDMODE_NONE:
			return SDL_BLENDMODE_NONE;
		case BLENDMODE_ALPHA:
			return SDL_BLENDMODE_BLEND;
		case BLENDMODE_RGB_MULTIPLY:
			return SDL_BLENDMODE_MOD;
		case BLENDMODE_ADD:
			return SDL_BLENDMODE_ADD;
		default:
			osd_printf_warning("Unknown Blendmode %d", blendmode);
	}
	return SDL_BLENDMODE_NONE;
}
开发者ID:bradhugh,项目名称:mame,代码行数:17,代码来源:draw13.cpp


示例18: share

void *finder_base::find_memshare(u8 width, size_t &bytes, bool required) const
{
	// look up the share and return nullptr if not found
	memory_share *const share(m_base.get().memshare(m_tag));
	if (!share)
		return nullptr;

	// check the width and warn if not correct
	if (width != 0 && share->bitwidth() != width)
	{
		if (required)
			osd_printf_warning("Shared ptr '%s' found but is width %d, not %d as requested\n", m_tag, share->bitwidth(), width);
		return nullptr;
	}

	// return results
	bytes = share->bytes();
	return share->ptr();
}
开发者ID:RafTacker,项目名称:mame,代码行数:19,代码来源:devfind.cpp


示例19: osd_printf_verbose

// FIXME: machine only used to access options.
void renderer_sdl2::init(running_machine &machine)
{
	osd_printf_verbose("Using SDL native texturing driver (SDL 2.0+)\n");

#if USE_OPENGL
	// Load the GL library now - else MT will fail
	const char *stemp = downcast<sdl_options &>(machine.options()).gl_lib();
#else
	const char *stemp = nullptr;
#endif
	if (stemp != nullptr && strcmp(stemp, OSDOPTVAL_AUTO) == 0)
		stemp = nullptr;

	// No fatalerror here since not all video drivers support GL !
	if (SDL_GL_LoadLibrary(stemp) != 0) // Load library (default for e==nullptr
		osd_printf_warning("Warning: Unable to load opengl library: %s\n", stemp ? stemp : "<default>");
	else
		osd_printf_verbose("Loaded opengl shared library: %s\n", stemp ? stemp : "<default>");
}
开发者ID:bradhugh,项目名称:mame,代码行数:20,代码来源:draw13.cpp


示例20: osd_printf_warning

void savquest_state::pci_3dfx_w(int function, int reg, uint32_t data, uint32_t mem_mask)
{
osd_printf_warning("PCI write: %x %x\n", reg, data);

	if (reg == 0x10)
	{
		data &= 0xff000000;
	}
	else if (reg == 0x40)
	{
		m_voodoo->voodoo_set_init_enable(data);
	}
	else if (reg == 0x54)
	{
		data &= 0xf000ffff; /* bits 16-27 are read-only */
	}

	m_pci_3dfx_regs[reg / 4] = data;
}
开发者ID:SailorSat,项目名称:cabmame,代码行数:19,代码来源:savquest.cpp



注:本文中的osd_printf_warning函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ osd_ticks函数代码示例发布时间:2022-05-30
下一篇:
C++ osd_printf_error函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap