Beispiel #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);
		}
	}
}
Beispiel #2
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);
}
Beispiel #3
0
static NVRAM_HANDLER( kickgoal )
{
	if (read_or_write) EEPROM_save(file);
	else
	{
		EEPROM_init(&eeprom_interface);
		if (file) EEPROM_load(file);
	}
}
Beispiel #4
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);
	}
}
static NVRAM_HANDLER( eolith )
{
	if (read_or_write)
		EEPROM_save(file);
	else
	{
		EEPROM_init(&eeprom_interface_93C66);
		if (file)	EEPROM_load(file);
	}
}
Beispiel #6
0
static NVRAM_HANDLER( policetr )
{
	if (read_or_write)
		EEPROM_save(file);
	else
	{
		EEPROM_init(&eeprom_interface_policetr);
		if (file)	EEPROM_load(file);
	}
}
Beispiel #7
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 */
	}
}
Beispiel #8
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 */
	}
}
Beispiel #9
0
BYTE EEPROM_load_data(RDA_MEMORY *mem)
{
    memset(mem, 0, sizeof(RDA_MEMORY));    
    if(EEPROM_load(EEPROM_ADDRESS, &addr, mem) != EEPROM_LOAD_FOUND)
    {
//LOG((ROMCHAR)"INVALID/NOT INIT. addr 0x%04X\r\n", addr);
        addr = EEPROM_MAX_ADDR;
        return 0;
    }
    
//LOG((ROMCHAR)"VALID addr 0x%04X\r\n", addr);
//LOG_ARRAY(mem->data, sizeof(RDA_MEMORY));
    
    return 1;
}
Beispiel #10
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);
		}
	}
}
Beispiel #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;
	}
}
Beispiel #12
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;
	}
}
Beispiel #13
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;
	}
}
Beispiel #14
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);
		}
	}
}
Beispiel #15
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);

		}
	}
}
Beispiel #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);
		}
	}
}