Exemplo n.º 1
0
static void eeprom_handler(mame_file *file, int read_or_write)
{
	if (read_or_write)
	{
		if (file)
		{
			EEPROM_save(file);
		}
	}
	else
	{
		EEPROM_init(&eeprom_interface);
		if (file)
		{
			EEPROM_load(file);
		}
		else
		{
			// set default eeprom
			UINT8 eepdata[0x200];
			memset(eepdata, 0xff, 0x200);

			if (mame_stricmp(Machine->gamedrv->name, "slrasslt") == 0)
			{
				// magic number
				eepdata[0x4] = 0x96;
				eepdata[0x5] = 0x72;
			}

			EEPROM_set_data(eepdata, 0x200);
		}
	}
}
Exemplo n.º 2
0
static NVRAM_HANDLER( kickgoal )
{
	if (read_or_write) EEPROM_save(file);
	else
	{
		EEPROM_init(&eeprom_interface);
		if (file) EEPROM_load(file);
	}
}
Exemplo n.º 3
0
static void cps2_nvram_read_write(int read_or_write)
{
	char path[MAX_PATH];

	sprintf(path, "%snvram/%s.nv", launchDir, game_name);

	if (read_or_write) EEPROM_save(path);
	else EEPROM_load(path);
}
Exemplo n.º 4
0
static NVRAM_HANDLER( eolith )
{
	if (read_or_write)
		EEPROM_save(file);
	else
	{
		EEPROM_init(&eeprom_interface_93C66);
		if (file)	EEPROM_load(file);
	}
}
Exemplo n.º 5
0
static NVRAM_HANDLER( policetr )
{
	if (read_or_write)
		EEPROM_save(file);
	else
	{
		EEPROM_init(&eeprom_interface_policetr);
		if (file)	EEPROM_load(file);
	}
}
Exemplo n.º 6
0
void nvram_handler_93C46(mame_file *file,int read_or_write)
{
	if (read_or_write)
		EEPROM_save(file);
	else
	{
		EEPROM_init(&eeprom_interface_93C46);
		if (file)	EEPROM_load(file);
	}
}
Exemplo n.º 7
0
static NVRAM_HANDLER( superchs )
{
	if (read_or_write)
		EEPROM_save(file);
	else
	{
		EEPROM_init(&superchs_eeprom_interface);

		if (file)
			EEPROM_load(file);
		else
			EEPROM_set_data(default_eeprom,128);  /* Default the wheel setup values */
	}
}
Exemplo n.º 8
0
static NVRAM_HANDLER( othunder )
{
	if (read_or_write)
		EEPROM_save(file);
	else
	{
		EEPROM_init(&eeprom_interface);

		if (file)
			EEPROM_load(file);
		else
			EEPROM_set_data(default_eeprom,128);  /* Default the gun setup values */
	}
}
Exemplo n.º 9
0
/****************************************************************
                NVRAM load/save/init
****************************************************************/
static NVRAM_HANDLER( xorworld )
{
	if (read_or_write)
	{
		EEPROM_save(file);
	}
	else
	{
		EEPROM_init(&eeprom_interface_93C46);

		if (file)
		{
			EEPROM_load(file);
		}
	}
}
Exemplo n.º 10
0
void simpsons_nvram_handler(void *file,int read_or_write)
{
	if (read_or_write)
		EEPROM_save(file);
	else
	{
		EEPROM_init(&eeprom_interface);

		if (file)
		{
			init_eeprom_count = 0;
			EEPROM_load(file);
		}
		else
			init_eeprom_count = 10;
	}
}
Exemplo n.º 11
0
static NVRAM_HANDLER(nvram_handler)
{
	if (read_or_write)
		EEPROM_save(file);
	else
	{
		EEPROM_init(&eeprom_interface);

		if (file)
		{
			init_eeprom_count = 0;
			EEPROM_load(file);
		}
		else
			init_eeprom_count = 10;
	}
}
Exemplo n.º 12
0
static NVRAM_HANDLER( gijoe )
{
	if (read_or_write)
		EEPROM_save(file);
	else
	{
		EEPROM_init(&eeprom_interface);

		if (file)
		{
			init_eeprom_count = 0;
			EEPROM_load(file);
		}
		else
			init_eeprom_count = 2720;
	}
}
Exemplo n.º 13
0
static NVRAM_HANDLER( pntnpuzl )
{
	if (read_or_write)
		EEPROM_save(file);
	else
	{
		EEPROM_init(&eeprom_interface);

		if (file)
			EEPROM_load(file);
		else
		{
			int length;
			UINT8 *dat;

			dat = EEPROM_get_data_pointer(&length);
			memset(dat, 0, length);
		}
	}
}
Exemplo n.º 14
0
static NVRAM_HANDLER( lethalen )
{
	if (read_or_write)
		EEPROM_save(file);
	else
	{
		EEPROM_init(&eeprom_interface);

		if (file)
		{
			init_eeprom_count = 0;
			EEPROM_load(file);
		}
		else
		{
			init_eeprom_count = 10;
			EEPROM_set_data(lethalen_default_eeprom,48);

		}
	}
}
Exemplo n.º 15
0
void EEPROM_save_data(const RDA_MEMORY *mem)
{
//WORD addr1 = 0;
//RDA_MEMORY mem1;   
//int j = 0;

    addr = EEPROM_save(EEPROM_ADDRESS, addr, mem);
    
//LOG((ROMCHAR)"-------------------------------\r\n");
//LOG((ROMCHAR)"addr 0x%04X\r\n", addr);

//LOG((ROMCHAR)"Reading...\r\n");
/*    
for(j = 0; j < 10; ++j)
{
    LOG((ROMCHAR)"addr 0x%04X\r\n", addr1);
    EEPROM_read(EEPROM_ADDRESS, addr1, mem1.data, sizeof(RDA_MEMORY));
    LOG_ARRAY(mem1.data, sizeof(RDA_MEMORY));
    addr1 += sizeof(RDA_MEMORY);
}    
*/
}
Exemplo n.º 16
0
static void cps1_nvram_read_write(int read_or_write)
{
	char path[MAX_PATH];
	FILE *fp;

	sprintf(path, "%snvram/%s.nv", launchDir, game_name);

	if (read_or_write)
	{
		if ((fp = fopen(path, "wb")) != NULL)
		{
			EEPROM_save(fp);
			fclose(fp);
		}
	}
	else
	{
		if ((fp = fopen(path, "rb")) != NULL)
		{
			EEPROM_load(fp);
			fclose(fp);
		}
	}
}
Exemplo n.º 17
0
static void lcd_silent_mode_set(){
    SilentModeMenu = !SilentModeMenu;
    EEPROM_save(4095,(uint8_t*)&SilentModeMenu,sizeof(SilentModeMenu));
      digipot_init();
    lcd_goto_menu(lcd_settings_menu, 7);
}