예제 #1
0
void ds1204_device::nvram_read( emu_file &file )
{
	file.read( m_unique_pattern, sizeof( m_unique_pattern ) );
	file.read( m_identification, sizeof( m_identification ) );
	file.read( m_security_match, sizeof( m_security_match ) );
	file.read( m_secure_memory, sizeof( m_secure_memory ) );
}
예제 #2
0
void intelfsh_device::nvram_read(emu_file &file)
{
	dynamic_buffer buffer(m_size);
	file.read(&buffer[0], m_size);
	for (int byte = 0; byte < m_size; byte++)
		m_addrspace[0]->write_byte(byte, buffer[byte]);
}
예제 #3
0
void nvram_device::nvram_read(emu_file &file)
{
	// make sure we have a valid base pointer
	determine_final_base();

	file.read(m_base, m_length);
}
예제 #4
0
파일: er2055.c 프로젝트: pinchyCZN/mameppk
void er2055_device::nvram_read(emu_file &file)
{
	UINT8 buffer[SIZE_DATA];
	file.read(buffer, sizeof(buffer));
	for (int byte = 0; byte < SIZE_DATA; byte++)
		m_addrspace[0]->write_byte(byte, buffer[byte]);
}
예제 #5
0
파일: eeprom.cpp 프로젝트: goofwear/mame
void eeprom_base_device::nvram_read(emu_file &file)
{
	uint32_t eeprom_length = 1 << m_address_bits;
	uint32_t eeprom_bytes = eeprom_length * m_data_bits / 8;

	file.read(&m_data[0], eeprom_bytes);
}
예제 #6
0
파일: intelfsh.c 프로젝트: tweakoz/vindigo
void intelfsh_device::nvram_read(emu_file &file)
{
	UINT8 *buffer = global_alloc_array(UINT8, m_size);
	file.read(buffer, m_size);
	for (int byte = 0; byte < m_size; byte++)
		m_addrspace[0]->write_byte(byte, buffer[byte]);
	global_free(buffer);
}
예제 #7
0
void mc146818_device::nvram_read(emu_file &file)
{
	file.read(m_data, data_size());

	set_base_datetime();
	update_timer();
	update_irq();
}
예제 #8
0
파일: x2212.c 프로젝트: bdidier/MAME-OS-X
void x2212_device::nvram_read(emu_file &file)
{
	UINT8 buffer[SIZE_DATA];
	file.read(buffer, sizeof(buffer));
	for (int byte = 0; byte < SIZE_DATA; byte++)
	{
		m_sram->write_byte(byte, 0xff);
		m_e2prom->write_byte(byte, buffer[byte]);
	}
}
예제 #9
0
파일: horizon.cpp 프로젝트: ursine/mame
void horizon_ramdisk_device::nvram_read(emu_file &file)
{
	int size = get_size();
	int readsize = file.read(m_nvram, size);
	// If we increased the size, fill the remaining parts with 0
	if (readsize < size)
	{
		memset(m_nvram + readsize, 0, size-readsize);
	}
}
예제 #10
0
파일: serflash.c 프로젝트: Ilgrim/MAMEHub
void serflash_device::nvram_read(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;


	if (file)
	{
		UINT32 page;
		file.read(&page, 4);
		while (page < size)
		{
			m_flashwritemap[page] = 1;
			file.read(m_region + page * FLASH_PAGE_SIZE, FLASH_PAGE_SIZE);
			file.read(&page, 4);
		}
	}

}
예제 #11
0
void x2212_device::nvram_read(emu_file &file)
{
	UINT8 *buffer = (UINT8 *) alloca(SIZE_DATA);
	file.read(buffer, SIZE_DATA);
	for (int byte = 0; byte < SIZE_DATA; byte++)
	{
		m_sram->write_byte(byte, 0xff);
		m_e2prom->write_byte(byte, buffer[byte]);
	}
}
예제 #12
0
void eeprom_base_device::nvram_read(emu_file &file)
{
	UINT32 eeprom_length = 1 << m_address_bits;
	UINT32 eeprom_bytes = eeprom_length * m_data_bits / 8;

	dynamic_buffer buffer(eeprom_bytes);
	file.read(&buffer[0], eeprom_bytes);
	for (offs_t offs = 0; offs < eeprom_bytes; offs++)
		m_addrspace[0]->write_byte(offs, buffer[offs]);
}
예제 #13
0
파일: at28c16.cpp 프로젝트: Dagarman/mame
void at28c16_device::nvram_read( emu_file &file )
{
	std::vector<uint8_t> buffer( AT28C16_TOTAL_BYTES );

	file.read( &buffer[0], AT28C16_TOTAL_BYTES );

	for( offs_t offs = 0; offs < AT28C16_TOTAL_BYTES; offs++ )
	{
		space(AS_PROGRAM).write_byte( offs, buffer[ offs ] );
	}
}
예제 #14
0
void at28c16_device::nvram_read( emu_file &file )
{
	dynamic_buffer buffer( AT28C16_TOTAL_BYTES );

	file.read( &buffer[0], AT28C16_TOTAL_BYTES );

	for( offs_t offs = 0; offs < AT28C16_TOTAL_BYTES; offs++ )
	{
		m_addrspace[ 0 ]->write_byte( offs, buffer[ offs ] );
	}
}
예제 #15
0
파일: eeprom.c 프로젝트: broftkd/mess-svn
void eeprom_device::nvram_read(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);
	file.read(buffer, eeprom_bytes);
	for (offs_t offs = 0; offs < eeprom_bytes; offs++)
		m_addrspace[0]->write_byte(offs, buffer[offs]);
	auto_free(machine(), buffer);
}
예제 #16
0
파일: save.c 프로젝트: Ojousama/MAMEHub
save_error save_manager::read_file(emu_file &file)
{
	// if we have illegal registrations, return an error
	if (m_illegal_regs > 0)
		return STATERR_ILLEGAL_REGISTRATIONS;

	// read the header and turn on compression for the rest of the file
	file.compress(FCOMPRESS_NONE);
	file.seek(0, SEEK_SET);
	UINT8 header[HEADER_SIZE];
	if (file.read(header, sizeof(header)) != sizeof(header))
		return STATERR_READ_ERROR;
	file.compress(FCOMPRESS_MEDIUM);

	// verify the header and report an error if it doesn't match
  // JJG: Allow invalid headers
	//UINT32 sig = signature();
	//if (validate_header(header, machine().system().name, sig, popmessage, "Error: ")  != STATERR_NONE)
  //return STATERR_INVALID_HEADER;

	// determine whether or not to flip the data when done
	bool flip = NATIVE_ENDIAN_VALUE_LE_BE((header[9] & SS_MSB_FIRST) != 0, (header[9] & SS_MSB_FIRST) == 0);

	// read all the data, flipping if necessary
	for (state_entry *entry = m_entry_list.first(); entry != NULL; entry = entry->next())
	{
		UINT32 totalsize = entry->m_typesize * entry->m_typecount;
		if (file.read(entry->m_data, totalsize) != totalsize)
			return STATERR_READ_ERROR;

		// handle flipping
		if (flip)
			entry->flip_data();
	}

	// call the post-load functions
	for (state_callback *func = m_postload_list.first(); func != NULL; func = func->next())
		func->m_func();

	return STATERR_NONE;
}
예제 #17
0
파일: i2cmem.cpp 프로젝트: Ashura-X/mame
void i2cmem_device::nvram_read( emu_file &file )
{
	int i2cmem_bytes = m_data_size;
	dynamic_buffer buffer ( i2cmem_bytes );

	file.read( &buffer[0], i2cmem_bytes );

	for( offs_t offs = 0; offs < i2cmem_bytes; offs++ )
	{
		space(AS_PROGRAM).write_byte( offs, buffer[ offs ] );
	}
}
예제 #18
0
파일: at28c16.c 프로젝트: bji/libmame
void at28c16_device::nvram_read( emu_file &file )
{
	UINT8 *buffer = auto_alloc_array( &m_machine, UINT8, AT28C16_TOTAL_BYTES );

	file.read( buffer, AT28C16_TOTAL_BYTES );

	for( offs_t offs = 0; offs < AT28C16_TOTAL_BYTES; offs++ )
	{
		m_addrspace[ 0 ]->write_byte( offs, buffer[ offs ] );
	}

	auto_free( &m_machine, buffer );
}
예제 #19
0
파일: save.c 프로젝트: opicron/mame
save_error save_manager::check_file(running_machine &machine, emu_file &file, const char *gamename, void (CLIB_DECL *errormsg)(const char *fmt, ...))
{
	// if we want to validate the signature, compute it
	UINT32 sig = 0;
	sig = machine.save().signature();

	// seek to the beginning and read the header
	file.compress(FCOMPRESS_NONE);
	file.seek(0, SEEK_SET);
	UINT8 header[HEADER_SIZE];
	if (file.read(header, sizeof(header)) != sizeof(header))
	{
		if (errormsg != NULL)
			(*errormsg)("Could not read %s save file header",emulator_info::get_appname());
		return STATERR_READ_ERROR;
	}

	// let the generic header check work out the rest
	return validate_header(header, gamename, sig, errormsg, "");
}
예제 #20
0
파일: horizon.cpp 프로젝트: Enverex/mame
void horizon_ramdisk_device::nvram_read(emu_file &file)
{
	int size = 2097152*(1 << ioport("HORIZONSIZE")->read());

	// NVRAM plus ROS
	uint8_t* buffer = global_alloc_array_clear<uint8_t>(MAXSIZE + ROSSIZE);

	memset(m_nvram->pointer(), 0,  size);
	memset(m_ros->pointer(), 0, ROSSIZE);

	// We assume the last 8K is ROS
	int filesize = file.read(buffer, MAXSIZE+ROSSIZE);
	int nvramsize = filesize - ROSSIZE;

	// If there is a reasonable size
	if (nvramsize >= 0)
	{
		// Copy from buffer to NVRAM and ROS
		memcpy(m_nvram->pointer(), buffer, nvramsize);
		memcpy(m_ros->pointer(), buffer + nvramsize, ROSSIZE);
	}

	global_free_array(buffer);
}
예제 #21
0
void m6m80011ap_device::nvram_read(emu_file &file)
{
	file.read(m_eeprom_data, 0x100);
}
예제 #22
0
파일: a2cffa.c 프로젝트: jiangzhonghui/mame
void a2bus_cffa2_6502_device::nvram_read(emu_file &file)
{
	file.read(m_eeprom, 0x1000);
}
예제 #23
0
void mc146818_device::nvram_read(emu_file &file)
{
	file.read(m_data, sizeof(m_data));
	set_base_datetime();
}
예제 #24
0
void atari_vg_earom_device::nvram_read(emu_file &file)
{
	file.read(m_rom,EAROM_SIZE);
}
예제 #25
0
void rp5c01_device::nvram_read(emu_file &file)
{
	if (m_battery_backed)
		file.read(m_ram, RAM_SIZE);
}
예제 #26
0
파일: ngp.c 프로젝트: antervud/MAMEHub
void ngp_state::nvram_read(emu_file &file)
{
	file.read(m_mainram, 0x3000);
	m_nvram_loaded = true;
}
예제 #27
0
void nmc9306_device::nvram_read(emu_file &file)
{
	file.read(m_register, RAM_SIZE);
}
예제 #28
0
void mccs1850_device::nvram_read(emu_file &file)
{
	file.read(m_ram, RAM_SIZE);
}
예제 #29
0
파일: at29x.cpp 프로젝트: Robbbert/store1
void at29x_device::nvram_read(emu_file &file)
{
	file.read(m_eememory.get(), m_memory_size+2);
}
예제 #30
0
파일: evpc.cpp 프로젝트: Ashura-X/mame
void snug_enhanced_video_device::nvram_read(emu_file &file)
{
	file.read(m_novram.get(), NOVRAM_SIZE);
}