Previous 199869 Revisions Next

r17475 Saturday 25th August, 2012 at 22:04:22 UTC by smf
use device_t.static_set_static_config
[src/emu/machine]am53cf96.c am53cf96.h wd33c93.c wd33c93.h

trunk/src/emu/machine/wd33c93.c
r17474r17475
744744{
745745}
746746
747void wd33c93_device::device_config_complete()
748{
749   // inherit a copy of the static data
750   const WD33C93interface *intf = reinterpret_cast<const WD33C93interface *>(static_config());
751   if (intf != NULL)
752   {
753      *static_cast<WD33C93interface *>(this) = *intf;
754   }
755}
756
747757void wd33c93_device::device_start()
748758{
749759   memset(&regs, 0, sizeof(regs));
r17474r17475
772782   save_item( NAME( read_pending ) );
773783}
774784
775void wd33c93_device::static_set_interface(device_t &device, const WD33C93interface &interface)
776{
777   wd33c93_device &wd33c93 = downcast<wd33c93_device &>(device);
778   static_cast<WD33C93interface &>(wd33c93) = interface;
779}
780
781785void wd33c93_device::get_dma_data( int bytes, UINT8 *pData )
782786{
783787   int len = bytes;
trunk/src/emu/machine/wd33c93.h
r17474r17475
5252#define TEMP_INPUT_LEN   262144
5353#define FIFO_SIZE      12
5454
55#define MCFG_WD33C93_ADD( _tag, _interface ) \
55#define MCFG_WD33C93_ADD( _tag, _config ) \
5656   MCFG_DEVICE_ADD( _tag, WD33C93, 0 ) \
57   wd33c93_device::static_set_interface(*device, _interface);
57   MCFG_DEVICE_CONFIG(_config)
5858
5959class wd33c93_device : public device_t,
6060                  public WD33C93interface
r17474r17475
6363   // construction/destruction
6464   wd33c93_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
6565
66   // inline configuration helpers
67   static void static_set_interface(device_t &device, const WD33C93interface &interface);
68
6966   DECLARE_READ8_MEMBER(read);
7067   DECLARE_WRITE8_MEMBER(write);
7168
r17474r17475
7673
7774protected:
7875   // device-level overrides
76   virtual void device_config_complete();
7977   virtual void device_start();
8078   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
8179
trunk/src/emu/machine/am53cf96.c
r17474r17475
162162{
163163}
164164
165void am53cf96_device::device_config_complete()
166{
167   // inherit a copy of the static data
168   const AM53CF96interface *intf = reinterpret_cast<const AM53CF96interface *>(static_config());
169   if (intf != NULL)
170   {
171      *static_cast<AM53CF96interface *>(this) = *intf;
172   }
173}
174
165175void am53cf96_device::device_start()
166176{
167177   memset(scsi_regs, 0, sizeof(scsi_regs));
r17474r17475
186196   m_transfer_timer = timer_alloc( TIMER_TRANSFER );
187197}
188198
189void am53cf96_device::static_set_interface(device_t &device, const AM53CF96interface &interface)
190{
191   am53cf96_device &am53cf96 = downcast<am53cf96_device &>(device);
192   static_cast<AM53CF96interface &>(am53cf96) = interface;
193}
194
195199// retrieve data from the SCSI controller
196200void am53cf96_device::dma_read_data(int bytes, UINT8 *pData)
197201{
trunk/src/emu/machine/am53cf96.h
r17474r17475
1515   void (*irq_callback)(running_machine &machine);   /* irq callback */
1616};
1717
18#define MCFG_AM53CF96_ADD( _tag, _interface ) \
18#define MCFG_AM53CF96_ADD( _tag, _config ) \
1919   MCFG_DEVICE_ADD( _tag, AM53CF96, 0 ) \
20   am53cf96_device::static_set_interface(*device, _interface);
20   MCFG_DEVICE_CONFIG(_config)
2121
2222// 53CF96 register set
2323enum
r17474r17475
4848   // construction/destruction
4949   am53cf96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
5050
51   // inline configuration helpers
52   static void static_set_interface(device_t &device, const AM53CF96interface &interface);
53
5451   DECLARE_READ8_MEMBER(read);
5552   DECLARE_WRITE8_MEMBER(write);
5653
r17474r17475
5956
6057protected:
6158   // device-level overrides
59   virtual void device_config_complete();
6260   virtual void device_start();
6361   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
6462

Previous 199869 Revisions Next


© 1997-2024 The MAME Team