Previous 199869 Revisions Next

r17614 Monday 3rd September, 2012 at 14:11:16 UTC by Miodrag Milanović
converted remaining legacy_device_base users (no whatsnew)
[src/emu/machine]s3c2400.c s3c2400.h s3c2410.c s3c2410.h s3c2440.c s3c2440.h s3c24xx.c

trunk/src/emu/machine/s3c2440.c
r17613r17614
7171   s3c24xx_video_start( device, device->machine());
7272}
7373
74DEVICE_GET_INFO( s3c2440 )
74const device_type S3C2440 = &device_creator<s3c2440_device>;
75
76s3c2440_device::s3c2440_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
77       : device_t(mconfig, S3C2440, "Samsung S3C2440", tag, owner, clock)
7578{
76   switch ( state )
77   {
78      /* --- the following bits of info are returned as pointers to data or functions --- */
79      case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(s3c2440); break;
80      /* --- the following bits of info are returned as NULL-terminated strings --- */
81      case DEVINFO_STR_NAME: strcpy(info->s, "Samsung S3C2440"); break;
82      /* --- default --- */
83      default: DEVICE_GET_INFO_CALL(s3c24xx); break;
84   }
79   m_token = global_alloc_array_clear(UINT8, sizeof(s3c24xx_t));
8580}
8681
82//-------------------------------------------------
83//  device_config_complete - perform any
84//  operations now that the configuration is
85//  complete
86//-------------------------------------------------
87
88void s3c2440_device::device_config_complete()
89{
90}
91
92//-------------------------------------------------
93//  device_start - device-specific startup
94//-------------------------------------------------
95
96void s3c2440_device::device_start()
97{
98   DEVICE_START_NAME( s3c2440 )(this);
99}
100
101//-------------------------------------------------
102//  device_reset - device-specific reset
103//-------------------------------------------------
104
105void s3c2440_device::device_reset()
106{
107   DEVICE_RESET_NAME( s3c24xx )(this);
108}
109
110
87111void s3c2440_uart_fifo_w( device_t *device, int uart, UINT8 data)
88112{
89113   s3c24xx_uart_fifo_w( device, uart, data);
r17613r17614
108132{
109133   s3c24xx_pin_frnb_w( device, state);
110134}
111
112s3c2440_device::s3c2440_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock)
113   : legacy_device_base(mconfig, type, tag, owner, clock, DEVICE_GET_INFO_NAME(s3c2440))
114{
115}
116
117const device_type S3C2440 = &legacy_device_creator<s3c2440_device>;
trunk/src/emu/machine/s3c2440.h
r17613r17614
4040   S3C2440_CORE_PIN_OM1
4141};
4242
43DEVICE_GET_INFO( s3c2440 );
44
45class s3c2440_device : public legacy_device_base
43class s3c2440_device : public device_t
4644{
4745public:
48   s3c2440_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock);
49   
46   s3c2440_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
47   ~s3c2440_device() { global_free(m_token); }
48   
49   // access to legacy token
50   void *token() const { assert(m_token != NULL); return m_token; }
51protected:
52   // device-level overrides
53   virtual void device_config_complete();
54   virtual void device_start();
55   virtual void device_reset();
56private:
57   // internal state
58   void *m_token;
59public:   
5060   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
5161};
5262
trunk/src/emu/machine/s3c24xx.c
r17613r17614
110110INLINE s3c24xx_t *get_token( device_t *device)
111111{
112112   assert(device != NULL);
113   return (s3c24xx_t *)downcast<legacy_device_base *>(device)->token();
113#if defined(DEVICE_S3C2400)
114   return (s3c24xx_t *)downcast<s3c2400_device *>(device)->token();
115#elif defined(DEVICE_S3C2410)
116   return (s3c24xx_t *)downcast<s3c2410_device *>(device)->token();
117#elif defined(DEVICE_S3C2440)
118   return (s3c24xx_t *)downcast<s3c2440_device *>(device)->token();
119#endif
114120}
115121
116122/***************************************************************************
r17613r17614
37013707   }
37023708   #endif
37033709}
3704
3705static DEVICE_GET_INFO( s3c24xx )
3706{
3707   switch ( state )
3708   {
3709      /* --- the following bits of info are returned as 64-bit signed integers --- */
3710      case DEVINFO_INT_TOKEN_BYTES:           info->i = sizeof(s3c24xx_t);                    break;
3711      /* --- the following bits of info are returned as pointers to data or functions --- */
3712      case DEVINFO_FCT_START:                 info->start = DEVICE_START_NAME(s3c24xx);       break;
3713      case DEVINFO_FCT_RESET:                 info->reset = DEVICE_RESET_NAME(s3c24xx);       break;
3714      /* --- the following bits of info are returned as NULL-terminated strings --- */
3715      case DEVINFO_STR_FAMILY:                strcpy(info->s, "S3C24XX");                     break;
3716      case DEVINFO_STR_VERSION:               strcpy(info->s, "1.00");                        break;
3717      case DEVINFO_STR_SOURCE_FILE:           strcpy(info->s, __FILE__);                      break;
3718      case DEVINFO_STR_CREDITS:               strcpy(info->s, "Copyright the MESS Team");   break;
3719   }
3720}
trunk/src/emu/machine/s3c2400.c
r17613r17614
6666   s3c24xx_video_start( device, device->machine());
6767}
6868
69DEVICE_GET_INFO( s3c2400 )
69const device_type S3C2400 = &device_creator<s3c2400_device>;
70
71s3c2400_device::s3c2400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
72       : device_t(mconfig, S3C2400, "Samsung S3C2400", tag, owner, clock)
7073{
71   switch ( state )
72   {
73      /* --- the following bits of info are returned as pointers to data or functions --- */
74      case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(s3c2400); break;
75      /* --- the following bits of info are returned as NULL-terminated strings --- */
76      case DEVINFO_STR_NAME: strcpy(info->s, "Samsung S3C2400"); break;
77      /* --- default --- */
78      default: DEVICE_GET_INFO_CALL(s3c24xx); break;
79    }
74   m_token = global_alloc_array_clear(UINT8, sizeof(s3c24xx_t));
8075}
8176
82void s3c2400_uart_fifo_w( device_t *device, int uart, UINT8 data)
77//-------------------------------------------------
78//  device_config_complete - perform any
79//  operations now that the configuration is
80//  complete
81//-------------------------------------------------
82
83void s3c2400_device::device_config_complete()
8384{
84   s3c24xx_uart_fifo_w( device, uart, data);
8585}
8686
87s3c2400_device::s3c2400_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock)
88   : legacy_device_base(mconfig, type, tag, owner, clock, DEVICE_GET_INFO_NAME(s3c2400))
87//-------------------------------------------------
88//  device_start - device-specific startup
89//-------------------------------------------------
90
91void s3c2400_device::device_start()
8992{
93   DEVICE_START_NAME( s3c2400 )(this);
9094}
9195
92const device_type S3C2400 = &legacy_device_creator<s3c2400_device>;
96//-------------------------------------------------
97//  device_reset - device-specific reset
98//-------------------------------------------------
99
100void s3c2400_device::device_reset()
101{
102   DEVICE_RESET_NAME( s3c24xx )(this);
103}
104
105void s3c2400_uart_fifo_w( device_t *device, int uart, UINT8 data)
106{
107   s3c24xx_uart_fifo_w( device, uart, data);
108}
109
trunk/src/emu/machine/s3c2400.h
r17613r17614
3333   S3C2400_GPIO_PORT_G
3434};
3535
36DEVICE_GET_INFO( s3c2400 );
37
38class s3c2400_device : public legacy_device_base
36class s3c2400_device : public device_t
3937{
4038public:
41   s3c2400_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock);
39   s3c2400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
40   ~s3c2400_device() { global_free(m_token); }
41   
42   // access to legacy token
43   void *token() const { assert(m_token != NULL); return m_token; }
4244   
45   // device-level overrides
46   virtual void device_config_complete();
47   virtual void device_start();
48   virtual void device_reset();
49private:
50   // internal state
51   void *m_token;
52public:   
4353   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
4454};
4555
trunk/src/emu/machine/s3c2410.c
r17613r17614
6969   s3c24xx_video_start( device, device->machine());
7070}
7171
72DEVICE_GET_INFO( s3c2410 )
72const device_type S3C2410 = &device_creator<s3c2410_device>;
73
74s3c2410_device::s3c2410_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
75       : device_t(mconfig, S3C2410, "Samsung S3C2410", tag, owner, clock)
7376{
74   switch ( state )
75   {
76      /* --- the following bits of info are returned as pointers to data or functions --- */
77      case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(s3c2410); break;
78      /* --- the following bits of info are returned as NULL-terminated strings --- */
79      case DEVINFO_STR_NAME: strcpy(info->s, "Samsung S3C2410"); break;
80      /* --- default --- */
81      default: DEVICE_GET_INFO_CALL(s3c24xx); break;
82   }
77   m_token = global_alloc_array_clear(UINT8, sizeof(s3c24xx_t));
8378}
8479
80//-------------------------------------------------
81//  device_config_complete - perform any
82//  operations now that the configuration is
83//  complete
84//-------------------------------------------------
85
86void s3c2410_device::device_config_complete()
87{
88}
89
90//-------------------------------------------------
91//  device_start - device-specific startup
92//-------------------------------------------------
93
94void s3c2410_device::device_start()
95{
96   DEVICE_START_NAME( s3c2410 )(this);
97}
98
99//-------------------------------------------------
100//  device_reset - device-specific reset
101//-------------------------------------------------
102
103void s3c2410_device::device_reset()
104{
105   DEVICE_RESET_NAME( s3c24xx )(this);
106}
107
85108void s3c2410_uart_fifo_w( device_t *device, int uart, UINT8 data)
86109{
87110   s3c24xx_uart_fifo_w( device, uart, data);
r17613r17614
108131   s3c24xx_request_eint( device, number);
109132}
110133
111s3c2410_device::s3c2410_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock)
112   : legacy_device_base(mconfig, type, tag, owner, clock, DEVICE_GET_INFO_NAME(s3c2410))
113{
114}
115
116const device_type S3C2410 = &legacy_device_creator<s3c2410_device>;
trunk/src/emu/machine/s3c2410.h
r17613r17614
4141   S3C2410_CORE_PIN_OM1
4242};
4343
44DEVICE_GET_INFO( s3c2410 );
45
46class s3c2410_device : public legacy_device_base
44class s3c2410_device : public device_t
4745{
4846public:
49   s3c2410_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock);
50   
47   s3c2410_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
48   ~s3c2410_device() { global_free(m_token); }
49   
50   // access to legacy token
51   void *token() const { assert(m_token != NULL); return m_token; }
52   // device-level overrides
53   virtual void device_config_complete();
54   virtual void device_start();
55   virtual void device_reset();
56private:
57   // internal state
58   void *m_token;
59public:     
5160   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
5261};
5362

Previous 199869 Revisions Next


© 1997-2024 The MAME Team