本文整理汇总了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 );
}
示例2: nvram_read
void atari_vg_earom_device::nvram_read(emu_file &file)
{
file.read(m_rom,EAROM_SIZE);
}
示例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");
}
}
}
示例4: nvram_read
void timekeeper_device::nvram_read(emu_file &file)
{
file.read( &m_data[0], m_size );
counters_to_ram();
}
示例5: sizeof
void pcf8593_device::nvram_read(emu_file &file)
{
file.read(m_data, sizeof(m_data));
}
示例6:
void at29040a_device::nvram_read(emu_file &file)
{
file.read(m_eememory, FEEPROM_SIZE+2);
}
示例7:
void mccs1850_device::nvram_write(emu_file &file)
{
file.write(m_ram, RAM_SIZE);
}
示例8: nvram_write
void nvram_device::nvram_write(emu_file &file)
{
file.write(m_base, m_length);
}
示例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
{
//.........这里部分代码省略.........
示例10: sizeof
void msx_s1985_device::nvram_write(emu_file &file)
{
file.write(m_backup_ram, sizeof(m_backup_ram));
}
示例11: nvram_write
void atari_vg_earom_device::nvram_write(emu_file &file)
{
file.write(m_rom,EAROM_SIZE);
}
示例12:
void mc146818_device::nvram_write(emu_file &file)
{
file.write(&m_data[0], data_size());
}
示例13: sizeof
void mc146818_device::nvram_read(emu_file &file)
{
file.read(m_data, sizeof(m_data));
set_base_datetime();
}
示例14: nvram_write
void horizon_ramdisk_device::nvram_write(emu_file &file)
{
int size = get_size();
file.write(m_nvram, size);
}
示例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");
}
}
}