converted remaining legacy_device_base users (no whatsnew)

This commit is contained in:
Miodrag Milanovic 2012-09-03 14:11:16 +00:00
parent b711b1a007
commit c052b16e98
7 changed files with 150 additions and 81 deletions

View File

@ -66,17 +66,40 @@ DEVICE_START( s3c2400 )
s3c24xx_video_start( device, device->machine());
}
DEVICE_GET_INFO( s3c2400 )
const device_type S3C2400 = &device_creator<s3c2400_device>;
s3c2400_device::s3c2400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, S3C2400, "Samsung S3C2400", tag, owner, clock)
{
switch ( state )
{
/* --- the following bits of info are returned as pointers to data or functions --- */
case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(s3c2400); break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case DEVINFO_STR_NAME: strcpy(info->s, "Samsung S3C2400"); break;
/* --- default --- */
default: DEVICE_GET_INFO_CALL(s3c24xx); break;
}
m_token = global_alloc_array_clear(UINT8, sizeof(s3c24xx_t));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void s3c2400_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void s3c2400_device::device_start()
{
DEVICE_START_NAME( s3c2400 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void s3c2400_device::device_reset()
{
DEVICE_RESET_NAME( s3c24xx )(this);
}
void s3c2400_uart_fifo_w( device_t *device, int uart, UINT8 data)
@ -84,9 +107,3 @@ void s3c2400_uart_fifo_w( device_t *device, int uart, UINT8 data)
s3c24xx_uart_fifo_w( device, uart, data);
}
s3c2400_device::s3c2400_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock)
: legacy_device_base(mconfig, type, tag, owner, clock, DEVICE_GET_INFO_NAME(s3c2400))
{
}
const device_type S3C2400 = &legacy_device_creator<s3c2400_device>;

View File

@ -33,13 +33,23 @@ enum
S3C2400_GPIO_PORT_G
};
DEVICE_GET_INFO( s3c2400 );
class s3c2400_device : public legacy_device_base
class s3c2400_device : public device_t
{
public:
s3c2400_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock);
s3c2400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~s3c2400_device() { global_free(m_token); }
// access to legacy token
void *token() const { assert(m_token != NULL); return m_token; }
// device-level overrides
virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
private:
// internal state
void *m_token;
public:
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
};

View File

@ -69,17 +69,40 @@ DEVICE_START( s3c2410 )
s3c24xx_video_start( device, device->machine());
}
DEVICE_GET_INFO( s3c2410 )
const device_type S3C2410 = &device_creator<s3c2410_device>;
s3c2410_device::s3c2410_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, S3C2410, "Samsung S3C2410", tag, owner, clock)
{
switch ( state )
{
/* --- the following bits of info are returned as pointers to data or functions --- */
case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(s3c2410); break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case DEVINFO_STR_NAME: strcpy(info->s, "Samsung S3C2410"); break;
/* --- default --- */
default: DEVICE_GET_INFO_CALL(s3c24xx); break;
}
m_token = global_alloc_array_clear(UINT8, sizeof(s3c24xx_t));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void s3c2410_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void s3c2410_device::device_start()
{
DEVICE_START_NAME( s3c2410 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void s3c2410_device::device_reset()
{
DEVICE_RESET_NAME( s3c24xx )(this);
}
void s3c2410_uart_fifo_w( device_t *device, int uart, UINT8 data)
@ -108,9 +131,3 @@ void s3c2410_request_eint( device_t *device, UINT32 number)
s3c24xx_request_eint( device, number);
}
s3c2410_device::s3c2410_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock)
: legacy_device_base(mconfig, type, tag, owner, clock, DEVICE_GET_INFO_NAME(s3c2410))
{
}
const device_type S3C2410 = &legacy_device_creator<s3c2410_device>;

View File

@ -41,13 +41,22 @@ enum
S3C2410_CORE_PIN_OM1
};
DEVICE_GET_INFO( s3c2410 );
class s3c2410_device : public legacy_device_base
class s3c2410_device : public device_t
{
public:
s3c2410_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock);
s3c2410_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~s3c2410_device() { global_free(m_token); }
// access to legacy token
void *token() const { assert(m_token != NULL); return m_token; }
// device-level overrides
virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
private:
// internal state
void *m_token;
public:
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
};

View File

@ -71,19 +71,43 @@ DEVICE_START( s3c2440 )
s3c24xx_video_start( device, device->machine());
}
DEVICE_GET_INFO( s3c2440 )
const device_type S3C2440 = &device_creator<s3c2440_device>;
s3c2440_device::s3c2440_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, S3C2440, "Samsung S3C2440", tag, owner, clock)
{
switch ( state )
{
/* --- the following bits of info are returned as pointers to data or functions --- */
case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(s3c2440); break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case DEVINFO_STR_NAME: strcpy(info->s, "Samsung S3C2440"); break;
/* --- default --- */
default: DEVICE_GET_INFO_CALL(s3c24xx); break;
}
m_token = global_alloc_array_clear(UINT8, sizeof(s3c24xx_t));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void s3c2440_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void s3c2440_device::device_start()
{
DEVICE_START_NAME( s3c2440 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void s3c2440_device::device_reset()
{
DEVICE_RESET_NAME( s3c24xx )(this);
}
void s3c2440_uart_fifo_w( device_t *device, int uart, UINT8 data)
{
s3c24xx_uart_fifo_w( device, uart, data);
@ -108,10 +132,3 @@ WRITE_LINE_DEVICE_HANDLER( s3c2440_pin_frnb_w )
{
s3c24xx_pin_frnb_w( device, state);
}
s3c2440_device::s3c2440_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock)
: legacy_device_base(mconfig, type, tag, owner, clock, DEVICE_GET_INFO_NAME(s3c2440))
{
}
const device_type S3C2440 = &legacy_device_creator<s3c2440_device>;

View File

@ -40,13 +40,23 @@ enum
S3C2440_CORE_PIN_OM1
};
DEVICE_GET_INFO( s3c2440 );
class s3c2440_device : public legacy_device_base
class s3c2440_device : public device_t
{
public:
s3c2440_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock);
s3c2440_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~s3c2440_device() { global_free(m_token); }
// access to legacy token
void *token() const { assert(m_token != NULL); return m_token; }
protected:
// device-level overrides
virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
private:
// internal state
void *m_token;
public:
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
};

View File

@ -110,7 +110,13 @@ static void s3c24xx_dma_request_pwm( device_t *device);
INLINE s3c24xx_t *get_token( device_t *device)
{
assert(device != NULL);
return (s3c24xx_t *)downcast<legacy_device_base *>(device)->token();
#if defined(DEVICE_S3C2400)
return (s3c24xx_t *)downcast<s3c2400_device *>(device)->token();
#elif defined(DEVICE_S3C2410)
return (s3c24xx_t *)downcast<s3c2410_device *>(device)->token();
#elif defined(DEVICE_S3C2440)
return (s3c24xx_t *)downcast<s3c2440_device *>(device)->token();
#endif
}
/***************************************************************************
@ -3701,20 +3707,3 @@ static DEVICE_START( s3c24xx )
}
#endif
}
static DEVICE_GET_INFO( s3c24xx )
{
switch ( state )
{
/* --- the following bits of info are returned as 64-bit signed integers --- */
case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(s3c24xx_t); break;
/* --- the following bits of info are returned as pointers to data or functions --- */
case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(s3c24xx); break;
case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(s3c24xx); break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case DEVINFO_STR_FAMILY: strcpy(info->s, "S3C24XX"); break;
case DEVINFO_STR_VERSION: strcpy(info->s, "1.00"); break;
case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break;
case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright the MESS Team"); break;
}
}