Previous 199869 Revisions Next

r17476 Saturday 25th August, 2012 at 22:20:45 UTC by smf
use device_t.static_set_static_config
[src/emu/machine]i2cmem.c i2cmem.h

trunk/src/emu/machine/i2cmem.c
r17475r17476
9797
9898
9999//-------------------------------------------------
100//  static_set_interface - set the device
101//  configuration
102//-------------------------------------------------
103
104void i2cmem_device::static_set_interface(device_t &device, const i2cmem_interface &interface)
105{
106   i2cmem_device &i2cmem = downcast<i2cmem_device &>(device);
107   static_cast<i2cmem_interface &>(i2cmem) = interface;
108}
109
110
111//-------------------------------------------------
112100//  device_config_complete - perform any
113101//  operations now that the configuration is
114102//  complete
r17475r17476
116104
117105void i2cmem_device::device_config_complete()
118106{
107   // inherit a copy of the static data
108   const i2cmem_interface *intf = reinterpret_cast<const i2cmem_interface *>(static_config());
109   if (intf != NULL)
110   {
111      *static_cast<i2cmem_interface *>(this) = *intf;
112   }
113
119114   m_space_config = address_space_config( "i2cmem", ENDIANNESS_BIG, 8,  m_address_bits, 0, *ADDRESS_MAP_NAME( i2cmem_map8 ) );
120115}
121116
122117
123118//-------------------------------------------------
124//  device_validity_check - perform validity checks
125//  on this device
126//-------------------------------------------------
127
128void i2cmem_device::device_validity_check(validity_checker &valid) const
129{
130}
131
132
133//-------------------------------------------------
134119//  device_start - device-specific startup
135120//-------------------------------------------------
136121
trunk/src/emu/machine/i2cmem.h
r17475r17476
2424//  INTERFACE CONFIGURATION MACROS
2525//**************************************************************************
2626
27#define MCFG_I2CMEM_ADD( _tag, _interface ) \
27#define MCFG_I2CMEM_ADD( _tag, _config ) \
2828   MCFG_DEVICE_ADD( _tag, I2CMEM, 0 ) \
29   i2cmem_device::static_set_interface(*device, _interface);
29   MCFG_DEVICE_CONFIG( _config )
3030
3131
3232//**************************************************************************
r17475r17476
5555   // construction/destruction
5656   i2cmem_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock );
5757
58   // inline configuration
59   static void static_set_interface(device_t &device, const i2cmem_interface &interface);
60
6158   // I/O operations
6259   void set_e0_line( int state );
6360   void set_e1_line( int state );
r17475r17476
7067protected:
7168   // device-level overrides
7269   virtual void device_config_complete();
73   virtual void device_validity_check(validity_checker &valid) const;
7470   virtual void device_start();
7571   virtual void device_reset();
7672

Previous 199869 Revisions Next


© 1997-2024 The MAME Team