Beispiel #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 ) );
}
Beispiel #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]);
}
Beispiel #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);
}
Beispiel #4
0
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]);
}
Beispiel #5
0
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);
}
Beispiel #6
0
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);
}
Beispiel #7
0
void mc146818_device::nvram_read(emu_file &file)
{
	file.read(m_data, data_size());

	set_base_datetime();
	update_timer();
	update_irq();
}
Beispiel #8
0
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]);
	}
}
Beispiel #9
0
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);
	}
}
Beispiel #10
0
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);
		}
	}

}
Beispiel #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]);
	}
}
Beispiel #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]);
}
Beispiel #13
0
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 ] );
	}
}
Beispiel #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 ] );
	}
}
Beispiel #15
0
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);
}
Beispiel #16
0
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;
}
Beispiel #17
0
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 ] );
	}
}
Beispiel #18
0
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 );
}
Beispiel #19
0
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, "");
}
Beispiel #20
0
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);
}
Beispiel #21
0
void m6m80011ap_device::nvram_read(emu_file &file)
{
	file.read(m_eeprom_data, 0x100);
}
Beispiel #22
0
void a2bus_cffa2_6502_device::nvram_read(emu_file &file)
{
	file.read(m_eeprom, 0x1000);
}
Beispiel #23
0
void mc146818_device::nvram_read(emu_file &file)
{
	file.read(m_data, sizeof(m_data));
	set_base_datetime();
}
Beispiel #24
0
void atari_vg_earom_device::nvram_read(emu_file &file)
{
	file.read(m_rom,EAROM_SIZE);
}
Beispiel #25
0
void rp5c01_device::nvram_read(emu_file &file)
{
	if (m_battery_backed)
		file.read(m_ram, RAM_SIZE);
}
Beispiel #26
0
void ngp_state::nvram_read(emu_file &file)
{
	file.read(m_mainram, 0x3000);
	m_nvram_loaded = true;
}
Beispiel #27
0
void nmc9306_device::nvram_read(emu_file &file)
{
	file.read(m_register, RAM_SIZE);
}
Beispiel #28
0
void mccs1850_device::nvram_read(emu_file &file)
{
	file.read(m_ram, RAM_SIZE);
}
Beispiel #29
0
void at29x_device::nvram_read(emu_file &file)
{
	file.read(m_eememory.get(), m_memory_size+2);
}
Beispiel #30
0
void snug_enhanced_video_device::nvram_read(emu_file &file)
{
	file.read(m_novram.get(), NOVRAM_SIZE);
}