use device_t.static_set_static_config

This commit is contained in:
smf- 2012-08-25 22:20:45 +00:00
parent 17aa09603a
commit 5895fb0137
2 changed files with 9 additions and 28 deletions

View File

@ -96,18 +96,6 @@ i2cmem_device::i2cmem_device( const machine_config &mconfig, const char *tag, de
}
//-------------------------------------------------
// static_set_interface - set the device
// configuration
//-------------------------------------------------
void i2cmem_device::static_set_interface(device_t &device, const i2cmem_interface &interface)
{
i2cmem_device &i2cmem = downcast<i2cmem_device &>(device);
static_cast<i2cmem_interface &>(i2cmem) = interface;
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
@ -116,20 +104,17 @@ void i2cmem_device::static_set_interface(device_t &device, const i2cmem_interfac
void i2cmem_device::device_config_complete()
{
// inherit a copy of the static data
const i2cmem_interface *intf = reinterpret_cast<const i2cmem_interface *>(static_config());
if (intf != NULL)
{
*static_cast<i2cmem_interface *>(this) = *intf;
}
m_space_config = address_space_config( "i2cmem", ENDIANNESS_BIG, 8, m_address_bits, 0, *ADDRESS_MAP_NAME( i2cmem_map8 ) );
}
//-------------------------------------------------
// device_validity_check - perform validity checks
// on this device
//-------------------------------------------------
void i2cmem_device::device_validity_check(validity_checker &valid) const
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------

View File

@ -24,9 +24,9 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_I2CMEM_ADD( _tag, _interface ) \
#define MCFG_I2CMEM_ADD( _tag, _config ) \
MCFG_DEVICE_ADD( _tag, I2CMEM, 0 ) \
i2cmem_device::static_set_interface(*device, _interface);
MCFG_DEVICE_CONFIG( _config )
//**************************************************************************
@ -55,9 +55,6 @@ public:
// construction/destruction
i2cmem_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock );
// inline configuration
static void static_set_interface(device_t &device, const i2cmem_interface &interface);
// I/O operations
void set_e0_line( int state );
void set_e1_line( int state );
@ -70,7 +67,6 @@ public:
protected:
// device-level overrides
virtual void device_config_complete();
virtual void device_validity_check(validity_checker &valid) const;
virtual void device_start();
virtual void device_reset();