Added tentative PORT_CUSTOM(eepromdev_bit_r) for EEPROM devices.

Not 100% sure this is the better way to implement this (we pass the eeprom tag as parameter of the PORT_CUSTOM), but I haven't been able to find a better solution.

No driver uses this yet, so I'm open to any suggestion before to use it extensively ;)
This commit is contained in:
Fabio Priuli 2009-11-18 13:26:30 +00:00
parent 778aebca90
commit ea72b5770d
2 changed files with 8 additions and 4 deletions

View File

@ -279,10 +279,14 @@ int eepromdev_read_bit(const device_config *device)
return res;
}
/*CUSTOM_INPUT( eeprom_bit_r )
CUSTOM_INPUT( eepromdev_bit_r )
{
return eeprom_read_bit();
}*/
const char *devtag = (const char *)param;
const device_config *eeprom = devtag_get_device(field->port->machine, devtag);
/* we test if the device is indeed an eeprom when calling this device handler */
return eepromdev_read_bit(eeprom);
}
void eepromdev_set_cs_line(const device_config *device, int state)
{

View File

@ -61,7 +61,7 @@ extern UINT8 *eeprom_empty_default_data;
void eepromdev_write_bit( const device_config *device, int bit );
int eepromdev_read_bit( const device_config *device );
//CUSTOM_INPUT( eeprom_bit_r );
CUSTOM_INPUT( eepromdev_bit_r );
void eepromdev_set_cs_line( const device_config *device, int state );
void eepromdev_set_clock_line( const device_config *device, int state );