summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Fabio Priuli <etabeta78@users.noreply.github.com>2009-11-18 13:26:30 +0000
committer Fabio Priuli <etabeta78@users.noreply.github.com>2009-11-18 13:26:30 +0000
commitea72b5770dd11276b3c35d87bf322ea9cd9ceb04 (patch)
treeae646fd0c63dbe383f7e5e74154f35e96a713f73 /src
parent778aebca901ad79fb2a1ddb72536cade39b9a094 (diff)
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 ;)
Diffstat (limited to 'src')
-rw-r--r--src/emu/machine/eepromdev.c10
-rw-r--r--src/emu/machine/eepromdev.h2
2 files changed, 8 insertions, 4 deletions
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 );