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

C++ emu_file类代码示例

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

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



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

示例1: nvram_write

void timekeeper_device::nvram_write(emu_file &file)
{
	file.write( &m_data[0], m_size );
}
开发者ID:curtiszimmerman,项目名称:mame,代码行数:4,代码来源:timekpr.c


示例2: nvram_read

void atari_vg_earom_device::nvram_read(emu_file &file)
{
	file.read(m_rom,EAROM_SIZE);
}
开发者ID:kleopatra999,项目名称:mame,代码行数:4,代码来源:atari_vg.c


示例3: if

void cheat_script::script_entry::save(emu_file &cheatfile) const
{
	// output an action
	if (m_format.empty())
	{
		cheatfile.printf("\t\t\t<action");
		if (!m_condition.is_empty())
			cheatfile.printf(" condition=\"%s\"", cheat_manager::quote_expression(m_condition).c_str());
		cheatfile.printf(">%s</action>\n", cheat_manager::quote_expression(m_expression).c_str());
	}

	// output an output
	else
	{
		cheatfile.printf("\t\t\t<output format=\"%s\"", m_format.c_str());
		if (!m_condition.is_empty())
			cheatfile.printf(" condition=\"%s\"", cheat_manager::quote_expression(m_condition).c_str());
		if (m_line != 0)
			cheatfile.printf(" line=\"%d\"", m_line);
		if (m_justify == ui::text_layout::CENTER)
			cheatfile.printf(" align=\"center\"");
		else if (m_justify == ui::text_layout::RIGHT)
			cheatfile.printf(" align=\"right\"");
		if (m_arglist.size() == 0)
			cheatfile.printf(" />\n");

		// output arguments
		else
		{
			cheatfile.printf(">\n");
			for (auto &curarg : m_arglist)
				curarg->save(cheatfile);
			cheatfile.printf("\t\t\t</output>\n");
		}
	}
}
开发者ID:bmunger,项目名称:mame,代码行数:36,代码来源:cheat.cpp


示例4: nvram_read

void timekeeper_device::nvram_read(emu_file &file)
{
	file.read( &m_data[0], m_size );

	counters_to_ram();
}
开发者ID:curtiszimmerman,项目名称:mame,代码行数:6,代码来源:timekpr.c


示例5: sizeof

void pcf8593_device::nvram_read(emu_file &file)
{
	file.read(m_data, sizeof(m_data));
}
开发者ID:AreaScout,项目名称:mame-libretro,代码行数:4,代码来源:pcf8593.c


示例6:

void at29040a_device::nvram_read(emu_file &file)
{
	file.read(m_eememory, FEEPROM_SIZE+2);
}
开发者ID:LeWoY,项目名称:MAMEHub,代码行数:4,代码来源:at29040a.c


示例7:

void mccs1850_device::nvram_write(emu_file &file)
{
	file.write(m_ram, RAM_SIZE);
}
开发者ID:dezi,项目名称:mame-libretro-odroid,代码行数:4,代码来源:mccs1850.c


示例8: nvram_write

void nvram_device::nvram_write(emu_file &file)
{
	file.write(m_base, m_length);
}
开发者ID:Chintiger,项目名称:mame,代码行数:4,代码来源:nvram.cpp


示例9: open_next

osd_file::error video_manager::open_next(emu_file &file, const char *extension)
{
	u32 origflags = file.openflags();

	// handle defaults
	const char *snapname = machine().options().snap_name();

	if (snapname == nullptr || snapname[0] == 0)
		snapname = "%g/%i";
	std::string snapstr(snapname);

	// strip any extension in the provided name
	int index = snapstr.find_last_of('.');
	if (index != -1)
		snapstr = snapstr.substr(0, index);

	// handle %d in the template (for image devices)
	std::string snapdev("%d_");
	int pos = snapstr.find(snapdev);

	if (pos != -1)
	{
		// if more %d are found, revert to default and ignore them all
		if (snapstr.find(snapdev.c_str(), pos + 3) != -1)
			snapstr.assign("%g/%i");
		// else if there is a single %d, try to create the correct snapname
		else
		{
			int name_found = 0;

			// find length of the device name
			int end1 = snapstr.find("/", pos + 3);
			int end2 = snapstr.find("%", pos + 3);
			int end;

			if ((end1 != -1) && (end2 != -1))
				end = std::min(end1, end2);
			else if (end1 != -1)
				end = end1;
			else if (end2 != -1)
				end = end2;
			else
				end = snapstr.length();

			if (end - pos < 3)
				fatalerror("Something very wrong is going on!!!\n");

			// copy the device name to an std::string
			std::string snapdevname;
			snapdevname.assign(snapstr.substr(pos + 3, end - pos - 3));
			//printf("check template: %s\n", snapdevname.c_str());

			// verify that there is such a device for this system
			for (device_image_interface &image : image_interface_iterator(machine().root_device()))
			{
				// get the device name
				std::string tempdevname(image.brief_instance_name());
				//printf("check device: %s\n", tempdevname.c_str());

				if (snapdevname.compare(tempdevname) == 0)
				{
					// verify that such a device has an image mounted
					if (image.basename() != nullptr)
					{
						std::string filename(image.basename());

						// strip extension
						filename = filename.substr(0, filename.find_last_of('.'));

						// setup snapname and remove the %d_
						strreplace(snapstr, snapdevname.c_str(), filename.c_str());
						snapstr.erase(pos, 3);
						//printf("check image: %s\n", filename.c_str());

						name_found = 1;
					}
				}
			}

			// or fallback to default
			if (name_found == 0)
				snapstr.assign("%g/%i");
		}
	}

	// add our own extension
	snapstr.append(".").append(extension);

	// substitute path and gamename up front
	strreplace(snapstr, "/", PATH_SEPARATOR);
	strreplace(snapstr, "%g", machine().basename());

	// determine if the template has an index; if not, we always use the same name
	std::string fname;
	if (snapstr.find("%i") == -1)
		fname.assign(snapstr);

	// otherwise, we scan for the next available filename
	else
	{
//.........这里部分代码省略.........
开发者ID:Tauwasser,项目名称:mame,代码行数:101,代码来源:video.cpp


示例10: sizeof

void msx_s1985_device::nvram_write(emu_file &file)
{
	file.write(m_backup_ram, sizeof(m_backup_ram));
}
开发者ID:qwijibo,项目名称:mame,代码行数:4,代码来源:msx_s1985.cpp


示例11: nvram_write

void atari_vg_earom_device::nvram_write(emu_file &file)
{
	file.write(m_rom,EAROM_SIZE);
}
开发者ID:kleopatra999,项目名称:mame,代码行数:4,代码来源:atari_vg.c


示例12:

void mc146818_device::nvram_write(emu_file &file)
{
    file.write(&m_data[0], data_size());
}
开发者ID:DragonMinded,项目名称:mame,代码行数:4,代码来源:mc146818.cpp


示例13: sizeof

void mc146818_device::nvram_read(emu_file &file)
{
	file.read(m_data, sizeof(m_data));
	set_base_datetime();
}
开发者ID:Ilgrim,项目名称:MAMEHub,代码行数:5,代码来源:mc146818.c


示例14: nvram_write

void horizon_ramdisk_device::nvram_write(emu_file &file)
{
	int size = get_size();
	file.write(m_nvram, size);
}
开发者ID:antervud,项目名称:MAMEHub,代码行数:5,代码来源:horizon.c


示例15: if

void cheat_script::script_entry::save(emu_file &cheatfile) const
{
	astring tempstring;

	// output an action
	if (!m_format)
	{
		cheatfile.printf("\t\t\t<action");
		if (!m_condition.is_empty())
			cheatfile.printf(" condition=\"%s\"", cheat_manager::quote_expression(tempstring, m_condition));
		cheatfile.printf(">%s</action>\n", cheat_manager::quote_expression(tempstring, m_expression));
	}

	// output an output
	else
	{
		cheatfile.printf("\t\t\t<output format=\"%s\"", m_format.cstr());
		if (!m_condition.is_empty())
			cheatfile.printf(" condition=\"%s\"", cheat_manager::quote_expression(tempstring, m_condition));
		if (m_line != 0)
			cheatfile.printf(" line=\"%d\"", m_line);
		if (m_justify == JUSTIFY_CENTER)
			cheatfile.printf(" align=\"center\"");
		else if (m_justify == JUSTIFY_RIGHT)
			cheatfile.printf(" align=\"right\"");
		if (m_arglist.count() == 0)
			cheatfile.printf(" />\n");

		// output arguments
		else
		{
			cheatfile.printf(">\n");
			for (const output_argument *curarg = m_arglist.first(); curarg != NULL; curarg = curarg->next())
				curarg->save(cheatfile);
			cheatfile.printf("\t\t\t</output>\n");
		}
	}
}
开发者ID:oboewan42,项目名称:frankenmame,代码行数:38,代码来源:cheat.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ emu_info类代码示例发布时间:2022-05-31
下一篇:
C++ element_type类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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