当前位置: 首页>>代码示例>>C++>>正文


C++ emu_file::write方法代码示例

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


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

示例1: write_file

save_error save_manager::write_file(emu_file &file)
{
	// if we have illegal registrations, return an error
	if (m_illegal_regs > 0)
		return STATERR_ILLEGAL_REGISTRATIONS;

	// generate the header
	UINT8 header[HEADER_SIZE];
	memcpy(&header[0], emulator_info::get_state_magic_num(), 8);
	header[8] = SAVE_VERSION;
	header[9] = NATIVE_ENDIAN_VALUE_LE_BE(0, SS_MSB_FIRST);
	strncpy((char *)&header[0x0a], machine().system().name, 0x1c - 0x0a);
	UINT32 sig = signature();
	*(UINT32 *)&header[0x1c] = LITTLE_ENDIANIZE_INT32(sig);

	// write the header and turn on compression for the rest of the file
	file.compress(FCOMPRESS_NONE);
	file.seek(0, SEEK_SET);
	if (file.write(header, sizeof(header)) != sizeof(header))
		return STATERR_WRITE_ERROR;
	file.compress(FCOMPRESS_MEDIUM);

	// call the pre-save functions
	for (state_callback *func = m_presave_list.first(); func != NULL; func = func->next())
		func->m_func();

	// then write all the data
	for (state_entry *entry = m_entry_list.first(); entry != NULL; entry = entry->next())
	{
		UINT32 totalsize = entry->m_typesize * entry->m_typecount;
		if (file.write(entry->m_data, totalsize) != totalsize)
			return STATERR_WRITE_ERROR;
	}
	return STATERR_NONE;
}
开发者ID:opicron,项目名称:mame,代码行数:35,代码来源:save.c

示例2: sizeof

void ds1204_device::nvram_write( emu_file &file )
{
	file.write( m_unique_pattern, sizeof( m_unique_pattern ) );
	file.write( m_identification, sizeof( m_identification ) );
	file.write( m_security_match, sizeof( m_security_match ) );
	file.write( m_secure_memory, sizeof( m_secure_memory ) );
}
开发者ID:Ander-son,项目名称:libretro-mame,代码行数:7,代码来源:ds1204.c

示例3: nvram_write

void intelfsh_device::nvram_write(emu_file &file)
{
	dynamic_buffer buffer(m_size);
	for (int byte = 0; byte < m_size; byte++)
		buffer[byte] = space(AS_PROGRAM).read_byte(byte);
	file.write(&buffer[0], m_size);
}
开发者ID:Ashura-X,项目名称:mame,代码行数:7,代码来源:intelfsh.cpp

示例4:

void at29x_device::nvram_write(emu_file &file)
{
	// If we don't write (because there were no changes), the file will be wiped
	if (TRACE_PRG) logerror("%s: Write to NVRAM file\n", tag());
	m_eememory[0] = m_version;
	file.write(m_eememory.get(), m_memory_size+2);
}
开发者ID:Robbbert,项目名称:store1,代码行数:7,代码来源:at29x.cpp

示例5: sizeof

void er2055_device::nvram_write(emu_file &file)
{
	UINT8 buffer[SIZE_DATA];
	for (int byte = 0; byte < SIZE_DATA; byte++)
		buffer[byte] = m_addrspace[0]->read_byte(byte);
	file.write(buffer, sizeof(buffer));
}
开发者ID:pinchyCZN,项目名称:mameppk,代码行数:7,代码来源:er2055.c

示例6: space

void er2055_device::nvram_write(emu_file &file)
{
	UINT8 buffer[SIZE_DATA];
	for (int byte = 0; byte < SIZE_DATA; byte++)
		buffer[byte] = space(AS_PROGRAM).read_byte(byte);
	file.write(buffer, sizeof(buffer));
}
开发者ID:Ashura-X,项目名称:mame,代码行数:7,代码来源:er2055.cpp

示例7: nvram_write

void intelfsh_device::nvram_write(emu_file &file)
{
	dynamic_buffer buffer(m_size);
	for (int byte = 0; byte < m_size; byte++)
		buffer[byte] = m_addrspace[0]->read_byte(byte);
	file.write(&buffer[0], m_size);
}
开发者ID:curtiszimmerman,项目名称:mame,代码行数:7,代码来源:intelfsh.c

示例8: nvram_write

void eeprom_base_device::nvram_write(emu_file &file)
{
	uint32_t eeprom_length = 1 << m_address_bits;
	uint32_t eeprom_bytes = eeprom_length * m_data_bits / 8;

	file.write(&m_data[0], eeprom_bytes);
}
开发者ID:goofwear,项目名称:mame,代码行数:7,代码来源:eeprom.cpp

示例9: nvram_write

void serflash_device::nvram_write(emu_file &file)
{
	if (m_length % FLASH_PAGE_SIZE) return; // region size must be multiple of flash page size
	int size = m_length /= FLASH_PAGE_SIZE;

	UINT32 page = 0;
	while (page < size)
	{
		if (m_flashwritemap[page])
		{
			file.write(&page, 4);
			file.write(m_region + page * FLASH_PAGE_SIZE, FLASH_PAGE_SIZE);
		}
		page++;
	}
	file.write(&page, 4);
}
开发者ID:Ilgrim,项目名称:MAMEHub,代码行数:17,代码来源:serflash.c

示例10: nvram_write

void intelfsh_device::nvram_write(emu_file &file)
{
	UINT8 *buffer = global_alloc_array(UINT8, m_size);
	for (int byte = 0; byte < m_size; byte++)
		buffer[byte] = m_addrspace[0]->read_byte(byte);
	file.write(buffer, m_size);
	global_free(buffer);
}
开发者ID:tweakoz,项目名称:vindigo,代码行数:8,代码来源:intelfsh.c

示例11: nvram_write

void eeprom_base_device::nvram_write(emu_file &file)
{
	UINT32 eeprom_length = 1 << m_address_bits;
	UINT32 eeprom_bytes = eeprom_length * m_data_bits / 8;

	dynamic_buffer buffer(eeprom_bytes);
	for (offs_t offs = 0; offs < eeprom_bytes; offs++)
		buffer[offs] = m_addrspace[0]->read_byte(offs);
	file.write(&buffer[0], eeprom_bytes);
}
开发者ID:DragonMinded,项目名称:mame,代码行数:10,代码来源:eeprom.cpp

示例12: nvram_write

void horizon_ramdisk_device::nvram_write(emu_file &file)
{
	int nvramsize = 2097152*(1 << ioport("HORIZONSIZE")->read());

	uint8_t* buffer = global_alloc_array_clear<uint8_t>(nvramsize + ROSSIZE);
	memcpy(buffer, m_nvram->pointer(), nvramsize);
	memcpy(buffer + nvramsize, m_ros->pointer(), ROSSIZE);

	file.write(buffer, nvramsize + ROSSIZE);
}
开发者ID:Enverex,项目名称:mame,代码行数:10,代码来源:horizon.cpp

示例13: nvram_write

void eeprom_device::nvram_write(emu_file &file)
{
	UINT32 eeprom_length = 1 << m_address_bits;
	UINT32 eeprom_bytes = eeprom_length * m_data_bits / 8;

	UINT8 *buffer = auto_alloc_array(machine(), UINT8, eeprom_bytes);
	for (offs_t offs = 0; offs < eeprom_bytes; offs++)
		buffer[offs] = m_addrspace[0]->read_byte(offs);
	file.write(buffer, eeprom_bytes);
	auto_free(machine(), buffer);
}
开发者ID:broftkd,项目名称:mess-svn,代码行数:11,代码来源:eeprom.c

示例14: buffer

void at28c16_device::nvram_write( emu_file &file )
{
	std::vector<uint8_t> buffer ( AT28C16_TOTAL_BYTES );

	for( offs_t offs = 0; offs < AT28C16_TOTAL_BYTES; offs++ )
	{
		buffer[ offs ] = space(AS_PROGRAM).read_byte( offs );
	}

	file.write( &buffer[0], AT28C16_TOTAL_BYTES );
}
开发者ID:Dagarman,项目名称:mame,代码行数:11,代码来源:at28c16.cpp

示例15: alloca

void x2212_device::nvram_write(emu_file &file)
{
	// auto-save causes an implicit store prior to exiting (writing)
	if (m_auto_save)
		store();

	UINT8 *buffer = (UINT8 *) alloca(SIZE_DATA);
	for (int byte = 0; byte < SIZE_DATA; byte++)
		buffer[byte] = m_e2prom->read_byte(byte);
	file.write(buffer, SIZE_DATA);
}
开发者ID:Ander-son,项目名称:libretro-mame,代码行数:11,代码来源:x2212.c


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