diff --git a/src/emu/machine/eepromdev.c b/src/emu/machine/eepromdev.c index a98a0fade10..1ea81effaea 100644 --- a/src/emu/machine/eepromdev.c +++ b/src/emu/machine/eepromdev.c @@ -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) { diff --git a/src/emu/machine/eepromdev.h b/src/emu/machine/eepromdev.h index beb383d565c..56ba586cb80 100644 --- a/src/emu/machine/eepromdev.h +++ b/src/emu/machine/eepromdev.h @@ -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 );