conversion of legacy devices into modern wip (no whatsnew)

This commit is contained in:
Miodrag Milanovic 2012-09-03 13:56:17 +00:00
parent f552908ea9
commit b711b1a007
418 changed files with 18530 additions and 954 deletions

View File

@ -141,7 +141,7 @@ INLINE tpi6525_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == TPI6525);
return (tpi6525_state *)downcast<legacy_device_base *>(device)->token();
return (tpi6525_state *)downcast<tpi6525_device *>(device)->token();
}
@ -619,4 +619,40 @@ UINT8 tpi6525_get_ddr_c(device_t *device)
return tpi6525->ddr_c;
}
DEFINE_LEGACY_DEVICE(TPI6525, tpi6525);
const device_type TPI6525 = &device_creator<tpi6525_device>;
tpi6525_device::tpi6525_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, TPI6525, "6525 TPI", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(tpi6525_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void tpi6525_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void tpi6525_device::device_start()
{
DEVICE_START_NAME( tpi6525 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void tpi6525_device::device_reset()
{
DEVICE_RESET_NAME( tpi6525 )(this);
}

View File

@ -57,7 +57,26 @@ struct _tpi6525_interface
DEVICE CONFIGURATION MACROS
***************************************************************************/
DECLARE_LEGACY_DEVICE(TPI6525, tpi6525);
class tpi6525_device : public device_t
{
public:
tpi6525_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~tpi6525_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;
};
extern const device_type TPI6525;
#define MCFG_TPI6525_ADD(_tag, _intrf) \
MCFG_DEVICE_ADD(_tag, TPI6525, 0) \

View File

@ -106,7 +106,7 @@ INLINE duart68681_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == DUART68681);
return (duart68681_state *)downcast<legacy_device_base *>(device)->token();
return (duart68681_state *)downcast<duart68681_device *>(device)->token();
}
static void duart68681_update_interrupts(duart68681_state *duart68681)
@ -928,4 +928,40 @@ DEVICE_GET_INFO(duart68681)
}
}
DEFINE_LEGACY_DEVICE(DUART68681, duart68681);
const device_type DUART68681 = &device_creator<duart68681_device>;
duart68681_device::duart68681_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, DUART68681, "DUART 68681", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(duart68681_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void duart68681_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void duart68681_device::device_start()
{
DEVICE_START_NAME( duart68681 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void duart68681_device::device_reset()
{
DEVICE_RESET_NAME( duart68681 )(this);
}

View File

@ -15,7 +15,26 @@ struct _duart68681_config
INT32 ip3clk, ip4clk, ip5clk, ip6clk;
};
DECLARE_LEGACY_DEVICE(DUART68681, duart68681);
class duart68681_device : public device_t
{
public:
duart68681_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~duart68681_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;
};
extern const device_type DUART68681;
#define MCFG_DUART68681_ADD(_tag, _clock, _config) \
MCFG_DEVICE_ADD(_tag, DUART68681, _clock) \

View File

@ -69,7 +69,7 @@ INLINE ttl74148_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == TTL74148);
return (ttl74148_state *)downcast<legacy_device_base *>(device)->token();
return (ttl74148_state *)downcast<ttl74148_device *>(device)->token();
}
void ttl74148_update(device_t *device)
@ -229,4 +229,40 @@ DEVICE_GET_INFO(ttl74148)
}
}
DEFINE_LEGACY_DEVICE(TTL74148, ttl74148);
const device_type TTL74148 = &device_creator<ttl74148_device>;
ttl74148_device::ttl74148_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, TTL74148, "74148", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(ttl74148_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void ttl74148_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void ttl74148_device::device_start()
{
DEVICE_START_NAME( ttl74148 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void ttl74148_device::device_reset()
{
DEVICE_RESET_NAME( ttl74148 )(this);
}

View File

@ -65,6 +65,25 @@ int ttl74148_output_r(device_t *device);
int ttl74148_output_valid_r(device_t *device);
int ttl74148_enable_output_r(device_t *device);
DECLARE_LEGACY_DEVICE(TTL74148, ttl74148);
class ttl74148_device : public device_t
{
public:
ttl74148_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~ttl74148_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;
};
extern const device_type TTL74148;
#endif

View File

@ -61,7 +61,7 @@ INLINE ttl74153_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == TTL74153);
return (ttl74153_state *)downcast<legacy_device_base *>(device)->token();
return (ttl74153_state *)downcast<ttl74153_device *>(device)->token();
}
@ -191,4 +191,40 @@ DEVICE_GET_INFO(ttl74153)
}
}
DEFINE_LEGACY_DEVICE(TTL74153, ttl74153);
const device_type TTL74153 = &device_creator<ttl74153_device>;
ttl74153_device::ttl74153_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, TTL74153, "74153", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(ttl74153_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void ttl74153_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void ttl74153_device::device_start()
{
DEVICE_START_NAME( ttl74153 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void ttl74153_device::device_reset()
{
DEVICE_RESET_NAME( ttl74153 )(this);
}

View File

@ -61,6 +61,25 @@ void ttl74153_input_line_w(device_t *device, int section, int input_line, int da
void ttl74153_enable_w(device_t *device, int section, int data);
int ttl74153_output_r(device_t *device, int section);
DECLARE_LEGACY_DEVICE(TTL74153, ttl74153);
class ttl74153_device : public device_t
{
public:
ttl74153_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~ttl74153_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;
};
extern const device_type TTL74153;
#endif

View File

@ -75,7 +75,7 @@ INLINE adc0831_state *get_safe_token( device_t *device )
{
assert( device != NULL );
assert( ( device->type() == ADC0831 ) || ( device->type() == ADC0832 ) || ( device->type() == ADC0834 ) || ( device->type() == ADC0838 ) );
return (adc0831_state *) downcast<legacy_device_base *>(device)->token();
return (adc0831_state *) downcast<adc0831_device *>(device)->token();
}
INLINE const adc083x_interface *get_interface( device_t *device )
@ -550,7 +550,69 @@ DEVICE_GET_INFO(adc0838)
}
}
DEFINE_LEGACY_DEVICE(ADC0831, adc0831);
DEFINE_LEGACY_DEVICE(ADC0832, adc0832);
DEFINE_LEGACY_DEVICE(ADC0834, adc0834);
DEFINE_LEGACY_DEVICE(ADC0838, adc0838);
const device_type ADC0831 = &device_creator<adc0831_device>;
adc0831_device::adc0831_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, ADC0831, "A/D Converters 0831", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(adc0831_state));
}
adc0831_device::adc0831_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, type, name, tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(adc0831_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void adc0831_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void adc0831_device::device_start()
{
DEVICE_START_NAME( adc0831 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void adc0831_device::device_reset()
{
DEVICE_RESET_NAME( adc0831 )(this);
}
const device_type ADC0832 = &device_creator<adc0832_device>;
adc0832_device::adc0832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: adc0831_device(mconfig, ADC0832, "A/D Converters 0832", tag, owner, clock)
{
}
const device_type ADC0834 = &device_creator<adc0834_device>;
adc0834_device::adc0834_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: adc0831_device(mconfig, ADC0834, "A/D Converters 0834", tag, owner, clock)
{
}
const device_type ADC0838 = &device_creator<adc0838_device>;
adc0838_device::adc0838_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: adc0831_device(mconfig, ADC0838, "A/D Converters 0838", tag, owner, clock)
{
}

View File

@ -32,10 +32,51 @@
MACROS / CONSTANTS
***************************************************************************/
DECLARE_LEGACY_DEVICE(ADC0831, adc0831);
DECLARE_LEGACY_DEVICE(ADC0832, adc0832);
DECLARE_LEGACY_DEVICE(ADC0834, adc0834);
DECLARE_LEGACY_DEVICE(ADC0838, adc0838);
class adc0831_device : public device_t
{
public:
adc0831_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
adc0831_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
~adc0831_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;
};
extern const device_type ADC0831;
class adc0832_device : public adc0831_device
{
public:
adc0832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type ADC0832;
class adc0834_device : public adc0831_device
{
public:
adc0834_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type ADC0834;
class adc0838_device : public adc0831_device
{
public:
adc0838_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type ADC0838;
#define MCFG_ADC0831_ADD(_tag, _config) \
MCFG_DEVICE_ADD(_tag, ADC0831, 0) \

View File

@ -38,7 +38,7 @@ INLINE adc1038_state *adc1038_get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == ADC1038);
return (adc1038_state *)downcast<legacy_device_base *>(device)->token();
return (adc1038_state *)downcast<adc1038_device *>(device)->token();
}
INLINE const adc1038_interface *adc1038_get_interface( device_t *device )
@ -179,4 +179,40 @@ DEVICE_GET_INFO(adc1038)
}
}
DEFINE_LEGACY_DEVICE(ADC1038, adc1038);
const device_type ADC1038 = &device_creator<adc1038_device>;
adc1038_device::adc1038_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, ADC1038, "A/D Converters 1038", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(adc1038_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void adc1038_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void adc1038_device::device_start()
{
DEVICE_START_NAME( adc1038 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void adc1038_device::device_reset()
{
DEVICE_RESET_NAME( adc1038 )(this);
}

View File

@ -31,7 +31,26 @@ struct _adc1038_interface
MACROS / CONSTANTS
***************************************************************************/
DECLARE_LEGACY_DEVICE(ADC1038, adc1038);
class adc1038_device : public device_t
{
public:
adc1038_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~adc1038_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;
};
extern const device_type ADC1038;
#define MCFG_ADC1038_ADD(_tag, _config) \
MCFG_DEVICE_ADD(_tag, ADC1038, 0) \

View File

@ -58,7 +58,7 @@ INLINE adc12138_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert((device->type() == ADC12130) || (device->type() == ADC12132) || (device->type() == ADC12138));
return (adc12138_state *)downcast<legacy_device_base *>(device)->token();
return (adc12138_state *)downcast<adc12138_device *>(device)->token();
}
INLINE const adc12138_interface *get_interface(device_t *device)
@ -390,6 +390,61 @@ DEVICE_GET_INFO(adc12132)
}
}
DEFINE_LEGACY_DEVICE(ADC12130, adc12130);
DEFINE_LEGACY_DEVICE(ADC12132, adc12132);
DEFINE_LEGACY_DEVICE(ADC12138, adc12138);
const device_type ADC12130 = &device_creator<adc12130_device>;
adc12130_device::adc12130_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: adc12138_device(mconfig, ADC12130, "A/D Converter 12130", tag, owner, clock)
{
}
const device_type ADC12132 = &device_creator<adc12132_device>;
adc12132_device::adc12132_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: adc12138_device(mconfig, ADC12132, "A/D Converter 12132", tag, owner, clock)
{
}
const device_type ADC12138 = &device_creator<adc12138_device>;
adc12138_device::adc12138_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, ADC12138, "A/D Converter 12138", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(adc12138_state));
}
adc12138_device::adc12138_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, type, name, tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(adc12138_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void adc12138_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void adc12138_device::device_start()
{
DEVICE_START_NAME( adc12138 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void adc12138_device::device_reset()
{
DEVICE_RESET_NAME( adc12138 )(this);
}

View File

@ -17,9 +17,42 @@
MACROS / CONSTANTS
***************************************************************************/
DECLARE_LEGACY_DEVICE(ADC12130, adc12130);
DECLARE_LEGACY_DEVICE(ADC12132, adc12132);
DECLARE_LEGACY_DEVICE(ADC12138, adc12138);
class adc12138_device : public device_t
{
public:
adc12138_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
adc12138_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
~adc12138_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;
};
extern const device_type ADC12138;
class adc12130_device : public adc12138_device
{
public:
adc12130_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type ADC12130;
class adc12132_device : public adc12138_device
{
public:
adc12132_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type ADC12132;
#define MCFG_ADC12130_ADD(_tag, _config) \
MCFG_DEVICE_ADD(_tag, ADC12130, 0) \

View File

@ -197,7 +197,7 @@ INLINE ide_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == IDE_CONTROLLER);
return (ide_state *)downcast<legacy_device_base *>(device)->token();
return (ide_state *)downcast<ide_controller_device *>(device)->token();
}
@ -1968,7 +1968,43 @@ DEVICE_GET_INFO( ide_controller )
}
DEFINE_LEGACY_DEVICE(IDE_CONTROLLER, ide_controller);
const device_type IDE_CONTROLLER = &device_creator<ide_controller_device>;
ide_controller_device::ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, IDE_CONTROLLER, "IDE Controller", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(ide_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void ide_controller_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void ide_controller_device::device_start()
{
DEVICE_START_NAME( ide_controller )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void ide_controller_device::device_reset()
{
DEVICE_RESET_NAME( ide_controller )(this);
}
//**************************************************************************
// IDE SLOT DEVICE

View File

@ -186,7 +186,26 @@ WRITE16_DEVICE_HANDLER( ide_controller16_w );
/* ----- device interface ----- */
DECLARE_LEGACY_DEVICE(IDE_CONTROLLER, ide_controller);
class ide_controller_device : public device_t
{
public:
ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~ide_controller_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;
};
extern const device_type IDE_CONTROLLER;
#endif /* __IDECTRL_H__ */

View File

@ -82,7 +82,7 @@ INLINE k053252_state *k053252_get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == K053252);
return (k053252_state *)downcast<legacy_device_base *>(device)->token();
return (k053252_state *)downcast<k053252_device *>(device)->token();
}
INLINE const k053252_interface *k053252_get_interface( device_t *device )
@ -252,5 +252,41 @@ DEVICE_GET_INFO( k053252 )
}
}
DEFINE_LEGACY_DEVICE(K053252, k053252);
const device_type K053252 = &device_creator<k053252_device>;
k053252_device::k053252_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, K053252, "Konami 053252", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(k053252_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void k053252_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void k053252_device::device_start()
{
DEVICE_START_NAME( k053252 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void k053252_device::device_reset()
{
DEVICE_RESET_NAME( k053252 )(this);
}

View File

@ -7,7 +7,26 @@
#include "devlegcy.h"
DECLARE_LEGACY_DEVICE(K053252, k053252);
class k053252_device : public device_t
{
public:
k053252_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~k053252_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;
};
extern const device_type K053252;

View File

@ -26,7 +26,7 @@ struct _latch8_t
INLINE latch8_t *get_safe_token(device_t *device) {
assert( device != NULL );
assert( device->type() == LATCH8 );
return ( latch8_t * ) downcast<legacy_device_base *>(device)->token();
return ( latch8_t * ) downcast<latch8_device *>(device)->token();
}
static void update(device_t *device, UINT8 new_val, UINT8 mask)
@ -253,10 +253,39 @@ DEVICE_GET_INFO( latch8 )
}
}
latch8_device::latch8_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(latch8))
const device_type LATCH8 = &device_creator<latch8_device>;
latch8_device::latch8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, LATCH8, "8 bit latch", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(latch8_t));
memset((void*)&m_inline_config,0,sizeof(m_inline_config));
}
const device_type LATCH8 = &legacy_device_creator<latch8_device>;
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void latch8_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void latch8_device::device_start()
{
DEVICE_START_NAME( latch8 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void latch8_device::device_reset()
{
DEVICE_RESET_NAME( latch8 )(this);
}

View File

@ -43,32 +43,40 @@ struct _latch8_config
latch8_devread devread[8];
};
DEVICE_GET_INFO( latch8 );
class latch8_device : public legacy_device_base
class latch8_device : public device_t
{
public:
latch8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock);
latch8_config m_inline_config;
void set_maskout(UINT32 maskout) { m_inline_config.maskout = maskout; }
void set_xorvalue(UINT32 xorvalue) { m_inline_config.xorvalue = xorvalue; }
void set_nosync(UINT32 nosync) { m_inline_config.nosync = nosync; }
void set_discrete_node(const char *dev_tag, int bit, UINT32 node) { m_inline_config.node_device[bit] = dev_tag; m_inline_config.node_map[bit] = node; }
void set_devread(int bit, const char *tag, read8_device_func handler, int from_bit)
{
m_inline_config.devread[bit].from_bit = from_bit;
m_inline_config.devread[bit].tag = tag;
m_inline_config.devread[bit].devread_handler = handler;
}
void set_read(int bit, read8_space_func handler, int from_bit)
{
m_inline_config.devread[bit].from_bit = from_bit;
m_inline_config.devread[bit].read_handler = handler;
}
latch8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~latch8_device() { global_free(m_token); }
// access to legacy token
void *token() const { assert(m_token != NULL); return m_token; }
latch8_config m_inline_config;
void set_maskout(UINT32 maskout) { m_inline_config.maskout = maskout; }
void set_xorvalue(UINT32 xorvalue) { m_inline_config.xorvalue = xorvalue; }
void set_nosync(UINT32 nosync) { m_inline_config.nosync = nosync; }
void set_discrete_node(const char *dev_tag, int bit, UINT32 node) { m_inline_config.node_device[bit] = dev_tag; m_inline_config.node_map[bit] = node; }
void set_devread(int bit, const char *tag, read8_device_func handler, int from_bit)
{
m_inline_config.devread[bit].from_bit = from_bit;
m_inline_config.devread[bit].tag = tag;
m_inline_config.devread[bit].devread_handler = handler;
}
void set_read(int bit, read8_space_func handler, int from_bit)
{
m_inline_config.devread[bit].from_bit = from_bit;
m_inline_config.devread[bit].read_handler = handler;
}
protected:
// device-level overrides
virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
private:
// internal state
void *m_token;
};
extern const device_type LATCH8;

View File

@ -23,7 +23,7 @@ INLINE mb14241_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == MB14241);
return (mb14241_state *)downcast<legacy_device_base *>(device)->token();
return (mb14241_state *)downcast<mb14241_device *>(device)->token();
}
/*****************************************************************************
@ -82,4 +82,40 @@ DEVICE_GET_INFO(mb14241)
}
}
DEFINE_LEGACY_DEVICE(MB14241, mb14241);
const device_type MB14241 = &device_creator<mb14241_device>;
mb14241_device::mb14241_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, MB14241, "MB14241", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(mb14241_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void mb14241_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void mb14241_device::device_start()
{
DEVICE_START_NAME( mb14241 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void mb14241_device::device_reset()
{
DEVICE_RESET_NAME( mb14241 )(this);
}

View File

@ -10,7 +10,26 @@
#include "devlegcy.h"
DECLARE_LEGACY_DEVICE(MB14241, mb14241);
class mb14241_device : public device_t
{
public:
mb14241_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~mb14241_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;
};
extern const device_type MB14241;
/***************************************************************************
DEVICE CONFIGURATION MACROS

View File

@ -116,7 +116,7 @@ INLINE mb87078_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == MB87078);
return (mb87078_state *)downcast<legacy_device_base *>(device)->token();
return (mb87078_state *)downcast<mb87078_device *>(device)->token();
}
INLINE const mb87078_interface *get_interface( device_t *device )
@ -280,4 +280,40 @@ DEVICE_GET_INFO(mb87078)
}
}
DEFINE_LEGACY_DEVICE(MB87078, mb87078);
const device_type MB87078 = &device_creator<mb87078_device>;
mb87078_device::mb87078_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, MB87078, "Fujitsu MB87078", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(mb87078_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void mb87078_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void mb87078_device::device_start()
{
DEVICE_START_NAME( mb87078 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void mb87078_device::device_reset()
{
DEVICE_RESET_NAME( mb87078 )(this);
}

View File

@ -24,7 +24,26 @@ struct _mb87078_interface
mb87078_gain_changed_cb gain_changed_cb;
};
DECLARE_LEGACY_DEVICE(MB87078, mb87078);
class mb87078_device : public device_t
{
public:
mb87078_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~mb87078_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;
};
extern const device_type MB87078;
/***************************************************************************
DEVICE CONFIGURATION MACROS

View File

@ -86,7 +86,7 @@ INLINE upd4990a_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert((device->type() == UPD4990A));
return (upd4990a_state *)downcast<legacy_device_base *>(device)->token();
return (upd4990a_state *)downcast<upd4990a_device *>(device)->token();
}
INLINE UINT8 convert_to_bcd(int val)
@ -539,4 +539,40 @@ DEVICE_GET_INFO(upd4990a)
}
}
DEFINE_LEGACY_DEVICE(UPD4990A, upd4990a);
const device_type UPD4990A = &device_creator<upd4990a_device>;
upd4990a_device::upd4990a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, UPD4990A, "NEC uPD4990A", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(upd4990a_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void upd4990a_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void upd4990a_device::device_start()
{
DEVICE_START_NAME( upd4990a )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void upd4990a_device::device_reset()
{
DEVICE_RESET_NAME( upd4990a )(this);
}

View File

@ -16,7 +16,26 @@
MACROS / CONSTANTS
***************************************************************************/
DECLARE_LEGACY_DEVICE(UPD4990A, upd4990a);
class upd4990a_device : public device_t
{
public:
upd4990a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~upd4990a_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;
};
extern const device_type UPD4990A;
#define MCFG_UPD4990A_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, UPD4990A, 0)

View File

@ -77,7 +77,7 @@ struct pic8259
INLINE pic8259_t *get_safe_token(device_t *device) {
assert( device != NULL );
assert( device->type() == PIC8259 );
return ( pic8259_t *) downcast<legacy_device_base *>(device)->token();
return ( pic8259_t *) downcast<pic8259_device *>(device)->token();
}
@ -469,4 +469,40 @@ DEVICE_GET_INFO( pic8259 ) {
}
DEFINE_LEGACY_DEVICE(PIC8259, pic8259);
const device_type PIC8259 = &device_creator<pic8259_device>;
pic8259_device::pic8259_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, PIC8259, "Intel PIC8259", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(pic8259_t));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void pic8259_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void pic8259_device::device_start()
{
DEVICE_START_NAME( pic8259 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void pic8259_device::device_reset()
{
DEVICE_RESET_NAME( pic8259 )(this);
}

View File

@ -28,7 +28,26 @@
#include "devlegcy.h"
#include "devcb.h"
DECLARE_LEGACY_DEVICE(PIC8259, pic8259);
class pic8259_device : public device_t
{
public:
pic8259_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~pic8259_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;
};
extern const device_type PIC8259;
/***************************************************************************
TYPE DEFINITIONS

View File

@ -107,7 +107,7 @@ INLINE pit8253_t *get_safe_token(device_t *device)
assert(device != NULL);
assert((device->type() == PIT8253) || (device->type() == PIT8254));
return (pit8253_t *) downcast<legacy_device_base *>(device)->token();
return (pit8253_t *) downcast<pit8253_device *>(device)->token();
}
@ -1188,5 +1188,62 @@ DEVICE_GET_INFO( pit8254 ) {
}
DEFINE_LEGACY_DEVICE(PIT8253, pit8253);
DEFINE_LEGACY_DEVICE(PIT8254, pit8254);
const device_type PIT8253 = &device_creator<pit8253_device>;
pit8253_device::pit8253_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, PIT8253, "Intel PIT8253", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(pit8253_t));
}
pit8253_device::pit8253_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, type, name, tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(pit8253_t));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void pit8253_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void pit8253_device::device_start()
{
DEVICE_START_NAME( pit8253 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void pit8253_device::device_reset()
{
DEVICE_RESET_NAME( pit8253 )(this);
}
const device_type PIT8254 = &device_creator<pit8254_device>;
pit8254_device::pit8254_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: pit8253_device(mconfig, PIT8254, "Intel PIT8254", tag, owner, clock)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void pit8254_device::device_start()
{
DEVICE_START_NAME( pit8254 )(this);
}

View File

@ -37,8 +37,38 @@ struct pit8253_config
} timer[3];
};
DECLARE_LEGACY_DEVICE(PIT8253, pit8253);
DECLARE_LEGACY_DEVICE(PIT8254, pit8254);
class pit8253_device : public device_t
{
public:
pit8253_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
pit8253_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
~pit8253_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;
};
extern const device_type PIT8253;
class pit8254_device : public pit8253_device
{
public:
pit8254_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
// device-level overrides
virtual void device_start();
};
extern const device_type PIT8254;
/***************************************************************************

View File

@ -48,7 +48,7 @@ INLINE rp5h01_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert((device->type() == RP5H01));
return (rp5h01_state *)downcast<legacy_device_base *>(device)->token();
return (rp5h01_state *)downcast<rp5h01_device *>(device)->token();
}
/***************************************************************************
@ -240,4 +240,40 @@ DEVICE_GET_INFO(rp5h01)
}
}
DEFINE_LEGACY_DEVICE(RP5H01, rp5h01);
const device_type RP5H01 = &device_creator<rp5h01_device>;
rp5h01_device::rp5h01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, RP5H01, "RP5H01", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(rp5h01_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void rp5h01_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void rp5h01_device::device_start()
{
DEVICE_START_NAME( rp5h01 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void rp5h01_device::device_reset()
{
DEVICE_RESET_NAME( rp5h01 )(this);
}

View File

@ -14,7 +14,26 @@
MACROS / CONSTANTS
***************************************************************************/
DECLARE_LEGACY_DEVICE(RP5H01, rp5h01);
class rp5h01_device : public device_t
{
public:
rp5h01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~rp5h01_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;
};
extern const device_type RP5H01;
#define MCFG_RP5H01_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, RP5H01, 0)

View File

@ -156,7 +156,7 @@ INLINE smc91c9x_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == SMC91C94 || device->type() == SMC91C96);
return (smc91c9x_state *)downcast<legacy_device_base *>(device)->token();
return (smc91c9x_state *)downcast<smc91c9x_device *>(device)->token();
}
@ -628,7 +628,55 @@ DEVICE_GET_INFO( smc91c96 )
}
}
smc91c9x_device::smc91c9x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, type, name, tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(smc91c9x_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void smc91c9x_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void smc91c9x_device::device_start()
{
DEVICE_START_NAME( smc91c9x )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void smc91c9x_device::device_reset()
{
DEVICE_RESET_NAME( smc91c9x )(this);
}
const device_type SMC91C94 = &device_creator<smc91c94_device>;
smc91c94_device::smc91c94_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: smc91c9x_device(mconfig, SMC91C94, "SMC91C94", tag, owner, clock)
{
}
const device_type SMC91C96 = &device_creator<smc91c96_device>;
smc91c96_device::smc91c96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: smc91c9x_device(mconfig, SMC91C96, "SMC91C96", tag, owner, clock)
{
}
DEFINE_LEGACY_DEVICE(SMC91C94, smc91c94);
DEFINE_LEGACY_DEVICE(SMC91C96, smc91c96);

View File

@ -50,8 +50,40 @@ WRITE16_DEVICE_HANDLER( smc91c9x_w );
/* ----- device interface ----- */
class smc91c9x_device : public device_t
{
public:
smc91c9x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
~smc91c9x_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;
};
class smc91c94_device : public smc91c9x_device
{
public:
smc91c94_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type SMC91C94;
class smc91c96_device : public smc91c9x_device
{
public:
smc91c96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type SMC91C96;
DECLARE_LEGACY_DEVICE(SMC91C94, smc91c94);
DECLARE_LEGACY_DEVICE(SMC91C96, smc91c96);
#endif

View File

@ -107,7 +107,7 @@ INLINE tms6100_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == TMS6100 ||
device->type() == M58819);
return (tms6100_state *)downcast<legacy_device_base *>(device)->token();
return (tms6100_state *)downcast<tms6100_device *>(device)->token();
}
/**********************************************************************************************
@ -288,5 +288,62 @@ DEVICE_GET_INFO(m58819)
}
}
DEFINE_LEGACY_DEVICE(TMS6100, tms6100);
DEFINE_LEGACY_DEVICE(M58819, m58819);
const device_type TMS6100 = &device_creator<tms6100_device>;
tms6100_device::tms6100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, TMS6100, "TMS6100", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(tms6100_state));
}
tms6100_device::tms6100_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, type, name, tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(tms6100_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void tms6100_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void tms6100_device::device_start()
{
DEVICE_START_NAME( tms6100 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void tms6100_device::device_reset()
{
DEVICE_RESET_NAME( tms6100 )(this);
}
const device_type M58819 = &device_creator<m58819_device>;
m58819_device::m58819_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: tms6100_device(mconfig, M58819, "M58819", tag, owner, clock)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void m58819_device::device_start()
{
DEVICE_START_NAME( m58819 )(this);
}

View File

@ -14,7 +14,37 @@ WRITE8_DEVICE_HANDLER( tms6100_addr_w );
READ_LINE_DEVICE_HANDLER( tms6100_data_r );
DECLARE_LEGACY_DEVICE(TMS6100, tms6100);
DECLARE_LEGACY_DEVICE(M58819, m58819);
class tms6100_device : public device_t
{
public:
tms6100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
tms6100_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
~tms6100_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;
};
extern const device_type TMS6100;
class m58819_device : public tms6100_device
{
public:
m58819_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
// device-level overrides
virtual void device_start();
};
extern const device_type M58819;
#endif /* __TMS6100_H__ */

View File

@ -49,7 +49,7 @@ INLINE upd4701_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert((device->type() == UPD4701));
return (upd4701_state *)downcast<legacy_device_base *>(device)->token();
return (upd4701_state *)downcast<upd4701_device *>(device)->token();
}
@ -319,4 +319,40 @@ DEVICE_GET_INFO(upd4701)
}
}
DEFINE_LEGACY_DEVICE(UPD4701, upd4701);
const device_type UPD4701 = &device_creator<upd4701_device>;
upd4701_device::upd4701_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, UPD4701, "NEC uPD4701 Encoder", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(upd4701_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void upd4701_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void upd4701_device::device_start()
{
DEVICE_START_NAME( upd4701 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void upd4701_device::device_reset()
{
DEVICE_RESET_NAME( upd4701 )(this);
}

View File

@ -15,7 +15,26 @@
MACROS / CONSTANTS
***************************************************************************/
DECLARE_LEGACY_DEVICE(UPD4701, upd4701);
class upd4701_device : public device_t
{
public:
upd4701_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~upd4701_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;
};
extern const device_type UPD4701;
#define MCFG_UPD4701_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, UPD4701, 0)

View File

@ -411,7 +411,7 @@ INLINE wd1770_state *get_safe_token(device_t *device)
device->type() == WD1770 || device->type() == WD1772 || device->type() == WD1773 ||
device->type() == MB8866 || device->type() == MB8876 || device->type() == MB8877);
return (wd1770_state *)downcast<legacy_device_base *>(device)->token();
return (wd1770_state *)downcast<wd1770_device *>(device)->token();
}
@ -2328,27 +2328,238 @@ DEVICE_GET_INFO(mb8877)
}
}
DEFINE_LEGACY_DEVICE(FD1771, fd1771);
DEFINE_LEGACY_DEVICE(FD1781, fd1781);
DEFINE_LEGACY_DEVICE(FD1791, fd1791);
DEFINE_LEGACY_DEVICE(FD1792, fd1792);
DEFINE_LEGACY_DEVICE(FD1793, fd1793);
DEFINE_LEGACY_DEVICE(FD1794, fd1794);
DEFINE_LEGACY_DEVICE(FD1795, fd1795);
DEFINE_LEGACY_DEVICE(FD1797, fd1797);
DEFINE_LEGACY_DEVICE(FD1761, fd1761);
DEFINE_LEGACY_DEVICE(FD1762, fd1762);
DEFINE_LEGACY_DEVICE(FD1763, fd1763);
DEFINE_LEGACY_DEVICE(FD1764, fd1764);
DEFINE_LEGACY_DEVICE(FD1765, fd1765);
DEFINE_LEGACY_DEVICE(FD1767, fd1767);
DEFINE_LEGACY_DEVICE(WD2791, wd2791);
DEFINE_LEGACY_DEVICE(WD2793, wd2793);
DEFINE_LEGACY_DEVICE(WD2795, wd2795);
DEFINE_LEGACY_DEVICE(WD2797, wd2797);
DEFINE_LEGACY_DEVICE(WD1770, wd1770);
DEFINE_LEGACY_DEVICE(WD1772, wd1772);
DEFINE_LEGACY_DEVICE(WD1773, wd1773);
DEFINE_LEGACY_DEVICE(MB8866, mb8866);
DEFINE_LEGACY_DEVICE(MB8876, mb8876);
DEFINE_LEGACY_DEVICE(MB8877, mb8877);
const device_type FD1771 = &device_creator<fd1771_device>;
fd1771_device::fd1771_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, FD1771, "FD1771", tag, owner, clock)
{
}
const device_type FD1781 = &device_creator<fd1781_device>;
fd1781_device::fd1781_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, FD1781, "FD1781", tag, owner, clock)
{
}
const device_type FD1791 = &device_creator<fd1791_device>;
fd1791_device::fd1791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, FD1791, "FD1791", tag, owner, clock)
{
}
const device_type FD1792 = &device_creator<fd1792_device>;
fd1792_device::fd1792_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, FD1792, "FD1792", tag, owner, clock)
{
}
const device_type FD1793 = &device_creator<fd1793_device>;
fd1793_device::fd1793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, FD1793, "FD1793", tag, owner, clock)
{
}
const device_type FD1794 = &device_creator<fd1794_device>;
fd1794_device::fd1794_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, FD1794, "FD1794", tag, owner, clock)
{
}
const device_type FD1795 = &device_creator<fd1795_device>;
fd1795_device::fd1795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, FD1795, "FD1795", tag, owner, clock)
{
}
const device_type FD1797 = &device_creator<fd1797_device>;
fd1797_device::fd1797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, FD1797, "FD1797", tag, owner, clock)
{
}
const device_type FD1761 = &device_creator<fd1761_device>;
fd1761_device::fd1761_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, FD1761, "FD1761", tag, owner, clock)
{
}
const device_type FD1762 = &device_creator<fd1762_device>;
fd1762_device::fd1762_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, FD1762, "FD1762", tag, owner, clock)
{
}
const device_type FD1763 = &device_creator<fd1763_device>;
fd1763_device::fd1763_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, FD1763, "FD1763", tag, owner, clock)
{
}
const device_type FD1764 = &device_creator<fd1764_device>;
fd1764_device::fd1764_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, FD1764, "FD1764", tag, owner, clock)
{
}
const device_type FD1765 = &device_creator<fd1765_device>;
fd1765_device::fd1765_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, FD1765, "FD1765", tag, owner, clock)
{
}
const device_type FD1767 = &device_creator<fd1767_device>;
fd1767_device::fd1767_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, FD1767, "FD1767", tag, owner, clock)
{
}
const device_type WD2791 = &device_creator<wd2791_device>;
wd2791_device::wd2791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, WD2791, "WD2791", tag, owner, clock)
{
}
const device_type WD2793 = &device_creator<wd2793_device>;
wd2793_device::wd2793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, WD2793, "WD2793", tag, owner, clock)
{
}
const device_type WD2795 = &device_creator<wd2795_device>;
wd2795_device::wd2795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, WD2795, "WD2795", tag, owner, clock)
{
}
const device_type WD2797 = &device_creator<wd2797_device>;
wd2797_device::wd2797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, WD2797, "WD2797", tag, owner, clock)
{
}
const device_type WD1770 = &device_creator<wd1770_device>;
wd1770_device::wd1770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, WD1770, "WD1770", tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(wd1770_state));
}
wd1770_device::wd1770_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, type, name, tag, owner, clock)
{
m_token = global_alloc_array_clear(UINT8, sizeof(wd1770_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void wd1770_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void wd1770_device::device_start()
{
DEVICE_START_NAME( wd1770 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void wd1770_device::device_reset()
{
DEVICE_RESET_NAME( wd1770 )(this);
}
const device_type WD1772 = &device_creator<wd1772_device>;
wd1772_device::wd1772_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, WD1772, "WD1772", tag, owner, clock)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void wd1772_device::device_start()
{
DEVICE_START_NAME( wd1772 )(this);
}
const device_type WD1773 = &device_creator<wd1773_device>;
wd1773_device::wd1773_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, WD1773, "WD1773", tag, owner, clock)
{
}
const device_type MB8866 = &device_creator<mb8866_device>;
mb8866_device::mb8866_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, MB8866, "MB8866", tag, owner, clock)
{
}
const device_type MB8876 = &device_creator<mb8876_device>;
mb8876_device::mb8876_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, MB8876, "MB8876", tag, owner, clock)
{
}
const device_type MB8877 = &device_creator<mb8877_device>;
mb8877_device::mb8877_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: wd1770_device(mconfig, MB8877, "MB8877", tag, owner, clock)
{
}

View File

@ -17,30 +17,214 @@
MACROS
***************************************************************************/
DECLARE_LEGACY_DEVICE(FD1771, fd1771);
DECLARE_LEGACY_DEVICE(FD1781, fd1781);
DECLARE_LEGACY_DEVICE(FD1791, fd1791);
DECLARE_LEGACY_DEVICE(FD1792, fd1792);
DECLARE_LEGACY_DEVICE(FD1793, fd1793);
DECLARE_LEGACY_DEVICE(FD1794, fd1794);
DECLARE_LEGACY_DEVICE(FD1795, fd1795);
DECLARE_LEGACY_DEVICE(FD1797, fd1797);
DECLARE_LEGACY_DEVICE(FD1761, fd1761);
DECLARE_LEGACY_DEVICE(FD1762, fd1762);
DECLARE_LEGACY_DEVICE(FD1763, fd1763);
DECLARE_LEGACY_DEVICE(FD1764, fd1764);
DECLARE_LEGACY_DEVICE(FD1765, fd1765);
DECLARE_LEGACY_DEVICE(FD1767, fd1767);
DECLARE_LEGACY_DEVICE(WD2791, wd2791);
DECLARE_LEGACY_DEVICE(WD2793, wd2793);
DECLARE_LEGACY_DEVICE(WD2795, wd2795);
DECLARE_LEGACY_DEVICE(WD2797, wd2797);
DECLARE_LEGACY_DEVICE(WD1770, wd1770);
DECLARE_LEGACY_DEVICE(WD1772, wd1772);
DECLARE_LEGACY_DEVICE(WD1773, wd1773);
DECLARE_LEGACY_DEVICE(MB8866, mb8866);
DECLARE_LEGACY_DEVICE(MB8876, mb8876);
DECLARE_LEGACY_DEVICE(MB8877, mb8877);
class wd1770_device : public device_t
{
public:
wd1770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
wd1770_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
~wd1770_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;
};
extern const device_type WD1770;
class fd1771_device : public wd1770_device
{
public:
fd1771_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type FD1771;
class fd1781_device : public wd1770_device
{
public:
fd1781_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type FD1781;
class fd1791_device : public wd1770_device
{
public:
fd1791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type FD1791;
class fd1792_device : public wd1770_device
{
public:
fd1792_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type FD1792;
class fd1793_device : public wd1770_device
{
public:
fd1793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type FD1793;
class fd1794_device : public wd1770_device
{
public:
fd1794_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type FD1794;
class fd1795_device : public wd1770_device
{
public:
fd1795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type FD1795;
class fd1797_device : public wd1770_device
{
public:
fd1797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type FD1797;
class fd1761_device : public wd1770_device
{
public:
fd1761_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type FD1761;
class fd1762_device : public wd1770_device
{
public:
fd1762_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type FD1762;
class fd1763_device : public wd1770_device
{
public:
fd1763_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type FD1763;
class fd1764_device : public wd1770_device
{
public:
fd1764_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type FD1764;
class fd1765_device : public wd1770_device
{
public:
fd1765_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type FD1765;
class fd1767_device : public wd1770_device
{
public:
fd1767_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type FD1767;
class wd2791_device : public wd1770_device
{
public:
wd2791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type WD2791;
class wd2793_device : public wd1770_device
{
public:
wd2793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type WD2793;
class wd2795_device : public wd1770_device
{
public:
wd2795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type WD2795;
class wd2797_device : public wd1770_device
{
public:
wd2797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type WD2797;
class wd1772_device : public wd1770_device
{
public:
wd1772_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
// device-level overrides
virtual void device_start();
};
extern const device_type WD1772;
class wd1773_device : public wd1770_device
{
public:
wd1773_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type WD1773;
class mb8866_device : public wd1770_device
{
public:
mb8866_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type MB8866;
class mb8876_device : public wd1770_device
{
public:
mb8876_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type MB8876;
class mb8877_device : public wd1770_device
{
public:
mb8877_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type MB8877;

View File

@ -28,7 +28,7 @@ INLINE ym2151_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YM2151);
return (ym2151_state *)downcast<legacy_device_base *>(device)->token();
return (ym2151_state *)downcast<ym2151_device *>(device)->token();
}
@ -146,4 +146,60 @@ DEVICE_GET_INFO( ym2151 )
}
DEFINE_LEGACY_SOUND_DEVICE(YM2151, ym2151);
const device_type YM2151 = &device_creator<ym2151_device>;
ym2151_device::ym2151_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, YM2151, "YM2151", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(ym2151_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void ym2151_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void ym2151_device::device_start()
{
DEVICE_START_NAME( ym2151 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void ym2151_device::device_reset()
{
DEVICE_RESET_NAME( ym2151 )(this);
}
//-------------------------------------------------
// device_stop - device-specific stop
//-------------------------------------------------
void ym2151_device::device_stop()
{
DEVICE_STOP_NAME( ym2151 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ym2151_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -19,6 +19,30 @@ READ8_DEVICE_HANDLER( ym2151_status_port_r );
WRITE8_DEVICE_HANDLER( ym2151_register_port_w );
WRITE8_DEVICE_HANDLER( ym2151_data_port_w );
DECLARE_LEGACY_SOUND_DEVICE(YM2151, ym2151);
class ym2151_device : public device_t,
public device_sound_interface
{
public:
ym2151_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~ym2151_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_stop();
virtual void device_reset();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type YM2151;
#endif /* __2151INTF_H__ */

View File

@ -20,7 +20,7 @@ INLINE ym2203_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YM2203);
return (ym2203_state *)downcast<legacy_device_base *>(device)->token();
return (ym2203_state *)downcast<ym2203_device *>(device)->token();
}
@ -208,4 +208,60 @@ DEVICE_GET_INFO( ym2203 )
}
DEFINE_LEGACY_SOUND_DEVICE(YM2203, ym2203);
const device_type YM2203 = &device_creator<ym2203_device>;
ym2203_device::ym2203_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, YM2203, "YM2203", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(ym2203_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void ym2203_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void ym2203_device::device_start()
{
DEVICE_START_NAME( ym2203 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void ym2203_device::device_reset()
{
DEVICE_RESET_NAME( ym2203 )(this);
}
//-------------------------------------------------
// device_stop - device-specific stop
//-------------------------------------------------
void ym2203_device::device_stop()
{
DEVICE_STOP_NAME( ym2203 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ym2203_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -24,6 +24,30 @@ READ8_DEVICE_HANDLER( ym2203_read_port_r );
WRITE8_DEVICE_HANDLER( ym2203_control_port_w );
WRITE8_DEVICE_HANDLER( ym2203_write_port_w );
DECLARE_LEGACY_SOUND_DEVICE(YM2203, ym2203);
class ym2203_device : public device_t,
public device_sound_interface
{
public:
ym2203_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~ym2203_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_stop();
virtual void device_reset();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type YM2203;
#endif /* __2203INTF_H__ */

View File

@ -22,7 +22,7 @@ INLINE ym2413_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YM2413);
return (ym2413_state *)downcast<legacy_device_base *>(device)->token();
return (ym2413_state *)downcast<ym2413_device *>(device)->token();
}
@ -142,4 +142,60 @@ DEVICE_GET_INFO( ym2413 )
}
DEFINE_LEGACY_SOUND_DEVICE(YM2413, ym2413);
const device_type YM2413 = &device_creator<ym2413_device>;
ym2413_device::ym2413_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, YM2413, "YM2413", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(ym2413_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void ym2413_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void ym2413_device::device_start()
{
DEVICE_START_NAME( ym2413 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void ym2413_device::device_reset()
{
DEVICE_RESET_NAME( ym2413 )(this);
}
//-------------------------------------------------
// device_stop - device-specific stop
//-------------------------------------------------
void ym2413_device::device_stop()
{
DEVICE_STOP_NAME( ym2413 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ym2413_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -10,6 +10,30 @@ WRITE8_DEVICE_HANDLER( ym2413_w );
WRITE8_DEVICE_HANDLER( ym2413_register_port_w );
WRITE8_DEVICE_HANDLER( ym2413_data_port_w );
DECLARE_LEGACY_SOUND_DEVICE(YM2413, ym2413);
class ym2413_device : public device_t,
public device_sound_interface
{
public:
ym2413_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~ym2413_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_stop();
virtual void device_reset();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type YM2413;
#endif /* __2413INTF_H__ */

View File

@ -32,7 +32,7 @@ INLINE ym2608_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YM2608);
return (ym2608_state *)downcast<legacy_device_base *>(device)->token();
return (ym2608_state *)downcast<ym2608_device *>(device)->token();
}
@ -232,4 +232,60 @@ DEVICE_GET_INFO( ym2608 )
}
DEFINE_LEGACY_SOUND_DEVICE(YM2608, ym2608);
const device_type YM2608 = &device_creator<ym2608_device>;
ym2608_device::ym2608_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, YM2608, "YM2608", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(ym2608_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void ym2608_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void ym2608_device::device_start()
{
DEVICE_START_NAME( ym2608 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void ym2608_device::device_reset()
{
DEVICE_RESET_NAME( ym2608 )(this);
}
//-------------------------------------------------
// device_stop - device-specific stop
//-------------------------------------------------
void ym2608_device::device_stop()
{
DEVICE_STOP_NAME( ym2608 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ym2608_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -29,6 +29,30 @@ WRITE8_DEVICE_HANDLER( ym2608_control_port_b_w );
WRITE8_DEVICE_HANDLER( ym2608_data_port_a_w );
WRITE8_DEVICE_HANDLER( ym2608_data_port_b_w );
DECLARE_LEGACY_SOUND_DEVICE(YM2608, ym2608);
class ym2608_device : public device_t,
public device_sound_interface
{
public:
ym2608_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~ym2608_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_stop();
virtual void device_reset();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type YM2608;
#endif /* __2608INTF_H__ */

View File

@ -32,7 +32,7 @@ INLINE ym2610_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YM2610 || device->type() == YM2610B);
return (ym2610_state *)downcast<legacy_device_base *>(device)->token();
return (ym2610_state *)downcast<ym2610_device *>(device)->token();
}
@ -256,5 +256,84 @@ DEVICE_GET_INFO( ym2610b )
}
DEFINE_LEGACY_SOUND_DEVICE(YM2610, ym2610);
DEFINE_LEGACY_SOUND_DEVICE(YM2610B, ym2610b);
const device_type YM2610 = &device_creator<ym2610_device>;
ym2610_device::ym2610_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, YM2610, "YM2610", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(ym2610_state));
}
ym2610_device::ym2610_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, type, name, tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(ym2610_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void ym2610_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void ym2610_device::device_start()
{
DEVICE_START_NAME( ym2610 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void ym2610_device::device_reset()
{
DEVICE_RESET_NAME( ym2610 )(this);
}
//-------------------------------------------------
// device_stop - device-specific stop
//-------------------------------------------------
void ym2610_device::device_stop()
{
DEVICE_STOP_NAME( ym2610 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ym2610_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}
const device_type YM2610B = &device_creator<ym2610b_device>;
ym2610b_device::ym2610b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: ym2610_device(mconfig, YM2610B, "YM2610B", tag, owner, clock)
{
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ym2610b_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -28,7 +28,42 @@ WRITE8_DEVICE_HANDLER( ym2610_data_port_a_w );
WRITE8_DEVICE_HANDLER( ym2610_data_port_b_w );
DECLARE_LEGACY_SOUND_DEVICE(YM2610, ym2610);
DECLARE_LEGACY_SOUND_DEVICE(YM2610B, ym2610b);
class ym2610_device : public device_t,
public device_sound_interface
{
public:
ym2610_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
ym2610_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
~ym2610_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_stop();
virtual void device_reset();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type YM2610;
class ym2610b_device : public ym2610_device
{
public:
ym2610b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
};
extern const device_type YM2610B;
#endif /* __2610INTF_H__ */

View File

@ -31,7 +31,7 @@ INLINE ym2612_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YM2612 || device->type() == YM3438);
return (ym2612_state *)downcast<legacy_device_base *>(device)->token();
return (ym2612_state *)downcast<ym2612_device *>(device)->token();
}
@ -198,5 +198,84 @@ DEVICE_GET_INFO( ym3438 )
}
DEFINE_LEGACY_SOUND_DEVICE(YM2612, ym2612);
DEFINE_LEGACY_SOUND_DEVICE(YM3438, ym3438);
const device_type YM2612 = &device_creator<ym2612_device>;
ym2612_device::ym2612_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, YM2612, "YM2612", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(ym2612_state));
}
ym2612_device::ym2612_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, type, name, tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(ym2612_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void ym2612_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void ym2612_device::device_start()
{
DEVICE_START_NAME( ym2612 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void ym2612_device::device_reset()
{
DEVICE_RESET_NAME( ym2612 )(this);
}
//-------------------------------------------------
// device_stop - device-specific stop
//-------------------------------------------------
void ym2612_device::device_stop()
{
DEVICE_STOP_NAME( ym2612 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ym2612_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}
const device_type YM3438 = &device_creator<ym3438_device>;
ym3438_device::ym3438_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: ym2612_device(mconfig, YM3438, "YM3438", tag, owner, clock)
{
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ym3438_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -27,7 +27,32 @@ WRITE8_DEVICE_HANDLER( ym2612_data_port_a_w );
WRITE8_DEVICE_HANDLER( ym2612_data_port_b_w );
DECLARE_LEGACY_SOUND_DEVICE(YM2612, ym2612);
class ym2612_device : public device_t,
public device_sound_interface
{
public:
ym2612_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
ym2612_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
~ym2612_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_stop();
virtual void device_reset();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type YM2612;
typedef struct _ym3438_interface ym3438_interface;
@ -51,6 +76,16 @@ struct _ym3438_interface
#define ym3438_data_port_b_w ym2612_data_port_b_w
DECLARE_LEGACY_SOUND_DEVICE(YM3438, ym3438);
class ym3438_device : public ym2612_device
{
public:
ym3438_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
};
extern const device_type YM3438;
#endif /* __2612INTF_H__ */

View File

@ -25,7 +25,7 @@ INLINE ymf262_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YMF262);
return (ymf262_state *)downcast<legacy_device_base *>(device)->token();
return (ymf262_state *)downcast<ymf262_device *>(device)->token();
}
@ -158,4 +158,60 @@ DEVICE_GET_INFO( ymf262 )
}
DEFINE_LEGACY_SOUND_DEVICE(YMF262, ymf262);
const device_type YMF262 = &device_creator<ymf262_device>;
ymf262_device::ymf262_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, YMF262, "YMF262", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(ymf262_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void ymf262_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void ymf262_device::device_start()
{
DEVICE_START_NAME( ymf262 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void ymf262_device::device_reset()
{
DEVICE_RESET_NAME( ymf262 )(this);
}
//-------------------------------------------------
// device_stop - device-specific stop
//-------------------------------------------------
void ymf262_device::device_stop()
{
DEVICE_STOP_NAME( ymf262 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ymf262_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -23,6 +23,30 @@ WRITE8_DEVICE_HANDLER( ymf262_data_a_w );
WRITE8_DEVICE_HANDLER( ymf262_data_b_w );
DECLARE_LEGACY_SOUND_DEVICE(YMF262, ymf262);
class ymf262_device : public device_t,
public device_sound_interface
{
public:
ymf262_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~ymf262_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_stop();
virtual void device_reset();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type YMF262;
#endif /* __262INTF_H__ */

View File

@ -39,7 +39,7 @@ INLINE ym3526_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YM3526);
return (ym3526_state *)downcast<legacy_device_base *>(device)->token();
return (ym3526_state *)downcast<ym3526_device *>(device)->token();
}
@ -171,4 +171,60 @@ DEVICE_GET_INFO( ym3526 )
}
DEFINE_LEGACY_SOUND_DEVICE(YM3526, ym3526);
const device_type YM3526 = &device_creator<ym3526_device>;
ym3526_device::ym3526_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, YM3526, "YM3526", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(ym3526_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void ym3526_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void ym3526_device::device_start()
{
DEVICE_START_NAME( ym3526 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void ym3526_device::device_reset()
{
DEVICE_RESET_NAME( ym3526 )(this);
}
//-------------------------------------------------
// device_stop - device-specific stop
//-------------------------------------------------
void ym3526_device::device_stop()
{
DEVICE_STOP_NAME( ym3526 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ym3526_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -19,6 +19,30 @@ READ8_DEVICE_HANDLER( ym3526_read_port_r );
WRITE8_DEVICE_HANDLER( ym3526_control_port_w );
WRITE8_DEVICE_HANDLER( ym3526_write_port_w );
DECLARE_LEGACY_SOUND_DEVICE(YM3526, ym3526);
class ym3526_device : public device_t,
public device_sound_interface
{
public:
ym3526_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~ym3526_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_stop();
virtual void device_reset();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type YM3526;
#endif /* __3526INTF_H__ */

View File

@ -37,7 +37,7 @@ INLINE ym3812_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YM3812);
return (ym3812_state *)downcast<legacy_device_base *>(device)->token();
return (ym3812_state *)downcast<ym3812_device *>(device)->token();
}
@ -167,4 +167,60 @@ DEVICE_GET_INFO( ym3812 )
}
DEFINE_LEGACY_SOUND_DEVICE(YM3812, ym3812);
const device_type YM3812 = &device_creator<ym3812_device>;
ym3812_device::ym3812_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, YM3812, "YM3812", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(ym3812_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void ym3812_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void ym3812_device::device_start()
{
DEVICE_START_NAME( ym3812 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void ym3812_device::device_reset()
{
DEVICE_RESET_NAME( ym3812 )(this);
}
//-------------------------------------------------
// device_stop - device-specific stop
//-------------------------------------------------
void ym3812_device::device_stop()
{
DEVICE_STOP_NAME( ym3812 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ym3812_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -19,6 +19,30 @@ READ8_DEVICE_HANDLER( ym3812_read_port_r );
WRITE8_DEVICE_HANDLER( ym3812_control_port_w );
WRITE8_DEVICE_HANDLER( ym3812_write_port_w );
DECLARE_LEGACY_SOUND_DEVICE(YM3812, ym3812);
class ym3812_device : public device_t,
public device_sound_interface
{
public:
ym3812_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~ym3812_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_stop();
virtual void device_reset();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type YM3812;
#endif /* __3812INTF_H__ */

View File

@ -37,7 +37,7 @@ INLINE y8950_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == Y8950);
return (y8950_state *)downcast<legacy_device_base *>(device)->token();
return (y8950_state *)downcast<y8950_device *>(device)->token();
}
@ -200,4 +200,60 @@ DEVICE_GET_INFO( y8950 )
}
DEFINE_LEGACY_SOUND_DEVICE(Y8950, y8950);
const device_type Y8950 = &device_creator<y8950_device>;
y8950_device::y8950_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, Y8950, "Y8950", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(y8950_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void y8950_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void y8950_device::device_start()
{
DEVICE_START_NAME( y8950 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void y8950_device::device_reset()
{
DEVICE_RESET_NAME( y8950 )(this);
}
//-------------------------------------------------
// device_stop - device-specific stop
//-------------------------------------------------
void y8950_device::device_stop()
{
DEVICE_STOP_NAME( y8950 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void y8950_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -24,6 +24,30 @@ READ8_DEVICE_HANDLER( y8950_read_port_r );
WRITE8_DEVICE_HANDLER( y8950_control_port_w );
WRITE8_DEVICE_HANDLER( y8950_write_port_w );
DECLARE_LEGACY_SOUND_DEVICE(Y8950, y8950);
class y8950_device : public device_t,
public device_sound_interface
{
public:
y8950_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~y8950_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_stop();
virtual void device_reset();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type Y8950;
#endif /* __8950INTF_H__ */

View File

@ -217,7 +217,7 @@ INLINE aica_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == AICA);
return (aica_state *)downcast<legacy_device_base *>(device)->token();
return (aica_state *)downcast<aica_device *>(device)->token();
}
static unsigned char DecodeSCI(aica_state *AICA, unsigned char irq)
@ -1380,4 +1380,51 @@ DEVICE_GET_INFO( aica )
DEFINE_LEGACY_SOUND_DEVICE(AICA, aica);
const device_type AICA = &device_creator<aica_device>;
aica_device::aica_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, AICA, "AICA", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(aica_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void aica_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void aica_device::device_start()
{
DEVICE_START_NAME( aica )(this);
}
//-------------------------------------------------
// device_stop - device-specific stop
//-------------------------------------------------
void aica_device::device_stop()
{
DEVICE_STOP_NAME( aica )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void aica_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -26,6 +26,29 @@ WRITE16_DEVICE_HANDLER( aica_w );
WRITE16_DEVICE_HANDLER( aica_midi_in );
READ16_DEVICE_HANDLER( aica_midi_out_r );
DECLARE_LEGACY_SOUND_DEVICE(AICA, aica);
class aica_device : public device_t,
public device_sound_interface
{
public:
aica_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~aica_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_stop();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type AICA;
#endif /* __AICA_H__ */

View File

@ -73,7 +73,7 @@ INLINE astrocade_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == ASTROCADE);
return (astrocade_state *)downcast<legacy_device_base *>(device)->token();
return (astrocade_state *)downcast<astrocade_device *>(device)->token();
}
@ -331,4 +331,51 @@ DEVICE_GET_INFO( astrocade )
}
DEFINE_LEGACY_SOUND_DEVICE(ASTROCADE, astrocade);
const device_type ASTROCADE = &device_creator<astrocade_device>;
astrocade_device::astrocade_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, ASTROCADE, "Astrocade", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(astrocade_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void astrocade_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void astrocade_device::device_start()
{
DEVICE_START_NAME( astrocade )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void astrocade_device::device_reset()
{
DEVICE_RESET_NAME( astrocade )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void astrocade_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -7,6 +7,29 @@
WRITE8_DEVICE_HANDLER( astrocade_sound_w );
DECLARE_LEGACY_SOUND_DEVICE(ASTROCADE, astrocade);
class astrocade_device : public device_t,
public device_sound_interface
{
public:
astrocade_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~astrocade_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();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type ASTROCADE;
#endif /* __ASTROCDE_H__ */

View File

@ -208,7 +208,7 @@ INLINE ay8910_context *get_safe_token(device_t *device)
device->type() == YM3439 ||
device->type() == YMZ284 ||
device->type() == YMZ294);
return (ay8910_context *)downcast<legacy_device_base *>(device)->token();
return (ay8910_context *)downcast<ay8910_device *>(device)->token();
}
@ -1000,7 +1000,6 @@ DEVICE_GET_INFO( ay8912 )
{
switch (state)
{
case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ay8910 ); break;
case DEVINFO_STR_NAME: strcpy(info->s, "AY-3-8912A"); break;
default: DEVICE_GET_INFO_CALL(ay8910); break;
}
@ -1010,7 +1009,6 @@ DEVICE_GET_INFO( ay8913 )
{
switch (state)
{
case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ay8910 ); break;
case DEVINFO_STR_NAME: strcpy(info->s, "AY-3-8913A"); break;
default: DEVICE_GET_INFO_CALL(ay8910); break;
}
@ -1020,7 +1018,6 @@ DEVICE_GET_INFO( ay8914 )
{
switch (state)
{
case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ay8910 ); break;
case DEVINFO_STR_NAME: strcpy(info->s, "AY-3-8914"); break;
default: DEVICE_GET_INFO_CALL(ay8910); break;
}
@ -1030,7 +1027,6 @@ DEVICE_GET_INFO( ay8930 )
{
switch (state)
{
case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ay8910 ); break;
case DEVINFO_STR_NAME: strcpy(info->s, "AY8930"); break;
default: DEVICE_GET_INFO_CALL(ay8910); break;
}
@ -1050,9 +1046,8 @@ DEVICE_GET_INFO( ym3439 )
{
switch (state)
{
case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ym2149 ); break;
case DEVINFO_STR_NAME: strcpy(info->s, "YM3439"); break;
default: DEVICE_GET_INFO_CALL(ay8910); break;
default: DEVICE_GET_INFO_CALL(ym2149); break;
}
}
@ -1060,9 +1055,8 @@ DEVICE_GET_INFO( ymz284 )
{
switch (state)
{
case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ym2149 ); break;
case DEVINFO_STR_NAME: strcpy(info->s, "YMZ284"); break;
default: DEVICE_GET_INFO_CALL(ay8910); break;
default: DEVICE_GET_INFO_CALL(ym2149); break;
}
}
@ -1070,9 +1064,8 @@ DEVICE_GET_INFO( ymz294 )
{
switch (state)
{
case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ym2149 ); break;
case DEVINFO_STR_NAME: strcpy(info->s, "YMZ294"); break;
default: DEVICE_GET_INFO_CALL(ay8910); break;
default: DEVICE_GET_INFO_CALL(ym2149); break;
}
}
@ -1139,12 +1132,223 @@ WRITE8_DEVICE_HANDLER( ay8914_w )
DEFINE_LEGACY_SOUND_DEVICE(AY8910, ay8910);
DEFINE_LEGACY_SOUND_DEVICE(AY8912, ay8912);
DEFINE_LEGACY_SOUND_DEVICE(AY8913, ay8913);
DEFINE_LEGACY_SOUND_DEVICE(AY8914, ay8914);
DEFINE_LEGACY_SOUND_DEVICE(AY8930, ay8930);
DEFINE_LEGACY_SOUND_DEVICE(YM2149, ym2149);
DEFINE_LEGACY_SOUND_DEVICE(YM3439, ym3439);
DEFINE_LEGACY_SOUND_DEVICE(YMZ284, ymz284);
DEFINE_LEGACY_SOUND_DEVICE(YMZ294, ymz294);
const device_type AY8910 = &device_creator<ay8910_device>;
ay8910_device::ay8910_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, AY8910, "AY-3-8910A", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(ay8910_context));
}
ay8910_device::ay8910_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, type, name, tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(ay8910_context));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void ay8910_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void ay8910_device::device_start()
{
DEVICE_START_NAME( ay8910 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void ay8910_device::device_reset()
{
DEVICE_RESET_NAME( ay8910 )(this);
}
//-------------------------------------------------
// device_stop - device-specific stop
//-------------------------------------------------
void ay8910_device::device_stop()
{
DEVICE_STOP_NAME( ay8910 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ay8910_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}
const device_type AY8912 = &device_creator<ay8912_device>;
ay8912_device::ay8912_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: ay8910_device(mconfig, AY8912, "AY-3-8912A", tag, owner, clock)
{
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ay8912_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}
const device_type AY8913 = &device_creator<ay8913_device>;
ay8913_device::ay8913_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: ay8910_device(mconfig, AY8913, "AY-3-8913A", tag, owner, clock)
{
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ay8913_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}
const device_type AY8914 = &device_creator<ay8914_device>;
ay8914_device::ay8914_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: ay8910_device(mconfig, AY8914, "AY-3-8914", tag, owner, clock)
{
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ay8914_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}
const device_type AY8930 = &device_creator<ay8930_device>;
ay8930_device::ay8930_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: ay8910_device(mconfig, AY8930, "AY8930", tag, owner, clock)
{
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ay8930_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}
const device_type YM2149 = &device_creator<ym2149_device>;
ym2149_device::ym2149_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: ay8910_device(mconfig, YM2149, "YM2149", tag, owner, clock)
{
}
ym2149_device::ym2149_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
: ay8910_device(mconfig, type, name, tag, owner, clock)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void ym2149_device::device_start()
{
DEVICE_START_NAME( ym2149 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ym2149_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}
const device_type YM3439 = &device_creator<ym3439_device>;
ym3439_device::ym3439_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: ym2149_device(mconfig, YM3439, "YM3439", tag, owner, clock)
{
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ym3439_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}
const device_type YMZ284 = &device_creator<ymz284_device>;
ymz284_device::ymz284_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: ym2149_device(mconfig, YMZ284, "YMZ284", tag, owner, clock)
{
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ymz284_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}
const device_type YMZ294 = &device_creator<ymz294_device>;
ymz294_device::ymz294_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: ym2149_device(mconfig, YMZ294, "YMZ294", tag, owner, clock)
{
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void ymz294_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -119,14 +119,123 @@ void ay8910_set_clock_ym(void *chip, int clock);
void ay8910_write_ym(void *chip, int addr, int data);
int ay8910_read_ym(void *chip);
DECLARE_LEGACY_SOUND_DEVICE(AY8910, ay8910);
DECLARE_LEGACY_SOUND_DEVICE(AY8912, ay8912);
DECLARE_LEGACY_SOUND_DEVICE(AY8913, ay8913);
DECLARE_LEGACY_SOUND_DEVICE(AY8914, ay8914);
DECLARE_LEGACY_SOUND_DEVICE(AY8930, ay8930);
DECLARE_LEGACY_SOUND_DEVICE(YM2149, ym2149);
DECLARE_LEGACY_SOUND_DEVICE(YM3439, ym3439);
DECLARE_LEGACY_SOUND_DEVICE(YMZ284, ymz284);
DECLARE_LEGACY_SOUND_DEVICE(YMZ294, ymz294);
class ay8910_device : public device_t,
public device_sound_interface
{
public:
ay8910_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
ay8910_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
~ay8910_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_stop();
virtual void device_reset();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type AY8910;
class ay8912_device : public ay8910_device
{
public:
ay8912_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
};
extern const device_type AY8912;
class ay8913_device : public ay8910_device
{
public:
ay8913_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
};
extern const device_type AY8913;
class ay8914_device : public ay8910_device
{
public:
ay8914_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
};
extern const device_type AY8914;
class ay8930_device : public ay8910_device
{
public:
ay8930_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
};
extern const device_type AY8930;
class ym2149_device : public ay8910_device
{
public:
ym2149_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
ym2149_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
protected:
// device-level overrides
virtual void device_start();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
};
extern const device_type YM2149;
class ym3439_device : public ym2149_device
{
public:
ym3439_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
};
extern const device_type YM3439;
class ymz284_device : public ym2149_device
{
public:
ymz284_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
};
extern const device_type YMZ284;
class ymz294_device : public ym2149_device
{
public:
ymz294_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
};
extern const device_type YMZ294;
#endif /* __AY8910_H__ */

View File

@ -32,7 +32,7 @@ INLINE beep_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == BEEP);
return (beep_state *)downcast<legacy_device_base *>(device)->token();
return (beep_state *)downcast<beep_device *>(device)->token();
}
@ -189,4 +189,42 @@ DEVICE_GET_INFO( beep )
}
DEFINE_LEGACY_SOUND_DEVICE(BEEP, beep);
const device_type BEEP = &device_creator<beep_device>;
beep_device::beep_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, BEEP, "Beep", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(beep_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void beep_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void beep_device::device_start()
{
DEVICE_START_NAME( beep )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void beep_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -11,6 +11,28 @@ void beep_set_state(device_t *device, int on);
void beep_set_frequency(device_t *device, int frequency);
void beep_set_volume(device_t *device, int volume);
DECLARE_LEGACY_SOUND_DEVICE(BEEP, beep);
class beep_device : public device_t,
public device_sound_interface
{
public:
beep_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~beep_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();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type BEEP;
#endif /* __BEEP_H__ */

View File

@ -109,7 +109,7 @@ INLINE c140_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == C140);
return (c140_state *)downcast<legacy_device_base *>(device)->token();
return (c140_state *)downcast<c140_device *>(device)->token();
}
@ -504,4 +504,42 @@ DEVICE_GET_INFO( c140 )
}
DEFINE_LEGACY_SOUND_DEVICE(C140, c140);
const device_type C140 = &device_creator<c140_device>;
c140_device::c140_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, C140, "C140", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(c140_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void c140_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void c140_device::device_start()
{
DEVICE_START_NAME( c140 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void c140_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -24,6 +24,28 @@ struct _c140_interface {
int banking_type;
};
DECLARE_LEGACY_SOUND_DEVICE(C140, c140);
class c140_device : public device_t,
public device_sound_interface
{
public:
c140_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~c140_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();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type C140;
#endif /* __C140_H__ */

View File

@ -86,7 +86,7 @@ INLINE c6280_t *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == C6280);
return (c6280_t *)downcast<legacy_device_base *>(device)->token();
return (c6280_t *)downcast<c6280_device *>(device)->token();
}
@ -372,4 +372,42 @@ DEVICE_GET_INFO( c6280 )
}
DEFINE_LEGACY_SOUND_DEVICE(C6280, c6280);
const device_type C6280 = &device_creator<c6280_device>;
c6280_device::c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, C6280, "HuC6280", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(c6280_t));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void c6280_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void c6280_device::device_start()
{
DEVICE_START_NAME( c6280 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void c6280_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -15,6 +15,28 @@ struct _c6280_interface
WRITE8_DEVICE_HANDLER( c6280_w );
READ8_DEVICE_HANDLER( c6280_r );
DECLARE_LEGACY_SOUND_DEVICE(C6280, c6280);
class c6280_device : public device_t,
public device_sound_interface
{
public:
c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~c6280_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();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type C6280;
#endif /* __C6280_H__ */

View File

@ -25,7 +25,7 @@ INLINE cdda_info *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == CDDA);
return (cdda_info *)downcast<legacy_device_base *>(device)->token();
return (cdda_info *)downcast<cdda_device *>(device)->token();
}
#define MAX_SECTORS ( 4 )
@ -339,4 +339,42 @@ DEVICE_GET_INFO( cdda )
}
DEFINE_LEGACY_SOUND_DEVICE(CDDA, cdda);
const device_type CDDA = &device_creator<cdda_device>;
cdda_device::cdda_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, CDDA, "CD/DA", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(cdda_info));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void cdda_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void cdda_device::device_start()
{
DEVICE_START_NAME( cdda )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void cdda_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -19,6 +19,28 @@ int cdda_audio_active(device_t *device);
int cdda_audio_paused(device_t *device);
int cdda_audio_ended(device_t *device);
DECLARE_LEGACY_SOUND_DEVICE(CDDA, cdda);
class cdda_device : public device_t,
public device_sound_interface
{
public:
cdda_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~cdda_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();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type CDDA;
#endif /* __CDDA_H__ */

View File

@ -141,7 +141,7 @@ INLINE cem3394_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == CEM3394);
return (cem3394_state *)downcast<legacy_device_base *>(device)->token();
return (cem3394_state *)downcast<cem3394_device *>(device)->token();
}
@ -586,4 +586,42 @@ DEVICE_GET_INFO( cem3394 )
}
DEFINE_LEGACY_SOUND_DEVICE(CEM3394, cem3394);
const device_type CEM3394 = &device_creator<cem3394_device>;
cem3394_device::cem3394_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, CEM3394, "CEM3394", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(cem3394_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void cem3394_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void cem3394_device::device_start()
{
DEVICE_START_NAME( cem3394 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void cem3394_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -45,6 +45,28 @@ void cem3394_set_voltage(device_t *device, int input, double voltage);
CEM3394_FINAL_GAIN: gain, in dB */
double cem3394_get_parameter(device_t *device, int input);
DECLARE_LEGACY_SOUND_DEVICE(CEM3394, cem3394);
class cem3394_device : public device_t,
public device_sound_interface
{
public:
cem3394_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~cem3394_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();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type CEM3394;
#endif /* __CEM3394_H__ */

View File

@ -288,7 +288,7 @@ INLINE digitalker *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == DIGITALKER);
return (digitalker *)downcast<legacy_device_base *>(device)->token();
return (digitalker *)downcast<digitalker_device *>(device)->token();
}
@ -705,4 +705,42 @@ WRITE8_DEVICE_HANDLER( digitalker_data_w )
}
DEFINE_LEGACY_SOUND_DEVICE(DIGITALKER, digitalker);
const device_type DIGITALKER = &device_creator<digitalker_device>;
digitalker_device::digitalker_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, DIGITALKER, "Digitalker", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(digitalker));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void digitalker_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void digitalker_device::device_start()
{
DEVICE_START_NAME( digitalker )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void digitalker_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -9,6 +9,28 @@ void digitalker_0_wr_w(device_t *device, int line);
int digitalker_0_intr_r(device_t *device);
WRITE8_DEVICE_HANDLER(digitalker_data_w);
DECLARE_LEGACY_SOUND_DEVICE(DIGITALKER, digitalker);
class digitalker_device : public device_t,
public device_sound_interface
{
public:
digitalker_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~digitalker_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();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type DIGITALKER;
#endif

View File

@ -59,7 +59,7 @@ INLINE dmadac_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == DMADAC);
return (dmadac_state *)downcast<legacy_device_base *>(device)->token();
return (dmadac_state *)downcast<dmadac_sound_device *>(device)->token();
}
@ -262,4 +262,42 @@ DEVICE_GET_INFO( dmadac_sound )
}
DEFINE_LEGACY_SOUND_DEVICE(DMADAC, dmadac_sound);
const device_type DMADAC = &device_creator<dmadac_sound_device>;
dmadac_sound_device::dmadac_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, DMADAC, "DMA-driven DAC", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(dmadac_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void dmadac_sound_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void dmadac_sound_device::device_start()
{
DEVICE_START_NAME( dmadac )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void dmadac_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -12,7 +12,29 @@
#include "devlegcy.h"
DECLARE_LEGACY_SOUND_DEVICE(DMADAC, dmadac_sound);
class dmadac_sound_device : public device_t,
public device_sound_interface
{
public:
dmadac_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~dmadac_sound_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();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type DMADAC;
void dmadac_transfer(dmadac_sound_device **devlist, UINT8 num_channels, offs_t channel_spacing, offs_t frame_spacing, offs_t total_frames, INT16 *data);
void dmadac_enable(dmadac_sound_device **devlist, UINT8 num_channels, UINT8 enable);

View File

@ -205,7 +205,7 @@ INLINE es5506_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == ES5505 || device->type() == ES5506);
return (es5506_state *)downcast<legacy_device_base *>(device)->token();
return (es5506_state *)downcast<es5505_device *>(device)->token();
}
@ -2207,5 +2207,117 @@ DEVICE_GET_INFO( es5506 )
}
DEFINE_LEGACY_SOUND_DEVICE(ES5505, es5505);
DEFINE_LEGACY_SOUND_DEVICE(ES5506, es5506);
const device_type ES5505 = &device_creator<es5505_device>;
es5505_device::es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, ES5505, "ES5505", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(es5506_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void es5505_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void es5505_device::device_start()
{
DEVICE_START_NAME( es5505 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void es5505_device::device_reset()
{
DEVICE_RESET_NAME( es5505 )(this);
}
//-------------------------------------------------
// device_stop - device-specific stop
//-------------------------------------------------
void es5505_device::device_stop()
{
DEVICE_STOP_NAME( es5505 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void es5505_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}
const device_type ES5506 = &device_creator<es5506_device>;
es5506_device::es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, ES5506, "ES5506", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(es5506_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void es5506_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void es5506_device::device_start()
{
DEVICE_START_NAME( es5506 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void es5506_device::device_reset()
{
DEVICE_RESET_NAME( es5506 )(this);
}
//-------------------------------------------------
// device_stop - device-specific stop
//-------------------------------------------------
void es5506_device::device_stop()
{
DEVICE_STOP_NAME( es5506 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void es5506_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -25,7 +25,31 @@ READ16_DEVICE_HANDLER( es5505_r );
WRITE16_DEVICE_HANDLER( es5505_w );
void es5505_voice_bank_w(device_t *device, int voice, int bank);
DECLARE_LEGACY_SOUND_DEVICE(ES5505, es5505);
class es5505_device : public device_t,
public device_sound_interface
{
public:
es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~es5505_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_stop();
virtual void device_reset();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type ES5505;
typedef struct _es5506_interface es5506_interface;
@ -43,6 +67,30 @@ READ8_DEVICE_HANDLER( es5506_r );
WRITE8_DEVICE_HANDLER( es5506_w );
void es5506_voice_bank_w(device_t *device, int voice, int bank);
DECLARE_LEGACY_SOUND_DEVICE(ES5506, es5506);
class es5506_device : public device_t,
public device_sound_interface
{
public:
es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~es5506_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_stop();
virtual void device_reset();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type ES5506;
#endif /* __ES5506_H__ */

View File

@ -51,7 +51,7 @@ INLINE es8712_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == ES8712);
return (es8712_state *)downcast<legacy_device_base *>(device)->token();
return (es8712_state *)downcast<es8712_device *>(device)->token();
}
@ -407,4 +407,51 @@ DEVICE_GET_INFO( es8712 )
}
DEFINE_LEGACY_SOUND_DEVICE(ES8712, es8712);
const device_type ES8712 = &device_creator<es8712_device>;
es8712_device::es8712_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, ES8712, "ES8712", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(es8712_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void es8712_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void es8712_device::device_start()
{
DEVICE_START_NAME( es8712 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void es8712_device::device_reset()
{
DEVICE_RESET_NAME( es8712 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void es8712_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -13,6 +13,29 @@ void es8712_set_frequency(device_t *device, int frequency);
WRITE8_DEVICE_HANDLER( es8712_w );
DECLARE_LEGACY_SOUND_DEVICE(ES8712, es8712);
class es8712_device : public device_t,
public device_sound_interface
{
public:
es8712_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~es8712_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();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type ES8712;
#endif /* __ES8712_H__ */

View File

@ -15,7 +15,7 @@ INLINE filter_rc_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == FILTER_RC);
return (filter_rc_state *)downcast<legacy_device_base *>(device)->token();
return (filter_rc_state *)downcast<filter_rc_device *>(device)->token();
}
const flt_rc_config flt_rc_ac_default = {FLT_RC_AC, 10000, 0, 0, CAP_U(1)};
@ -137,4 +137,42 @@ DEVICE_GET_INFO( filter_rc )
}
DEFINE_LEGACY_SOUND_DEVICE(FILTER_RC, filter_rc);
const device_type FILTER_RC = &device_creator<filter_rc_device>;
filter_rc_device::filter_rc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, FILTER_RC, "RC Filter", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(filter_rc_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void filter_rc_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void filter_rc_device::device_start()
{
DEVICE_START_NAME( filter_rc )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void filter_rc_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -59,6 +59,28 @@ extern const flt_rc_config flt_rc_ac_default;
void filter_rc_set_RC(device_t *device, int type, double R1, double R2, double R3, double C);
DECLARE_LEGACY_SOUND_DEVICE(FILTER_RC, filter_rc);
class filter_rc_device : public device_t,
public device_sound_interface
{
public:
filter_rc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~filter_rc_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();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type FILTER_RC;
#endif /* __FLT_RC_H__ */

View File

@ -13,7 +13,7 @@ INLINE filter_volume_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == FILTER_VOLUME);
return (filter_volume_state *)downcast<legacy_device_base *>(device)->token();
return (filter_volume_state *)downcast<filter_volume_device *>(device)->token();
}
@ -72,4 +72,42 @@ DEVICE_GET_INFO( filter_volume )
}
DEFINE_LEGACY_SOUND_DEVICE(FILTER_VOLUME, filter_volume);
const device_type FILTER_VOLUME = &device_creator<filter_volume_device>;
filter_volume_device::filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, FILTER_VOLUME, "Volume Filter", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(filter_volume_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void filter_volume_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void filter_volume_device::device_start()
{
DEVICE_START_NAME( filter_volume )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void filter_volume_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -8,6 +8,28 @@
void flt_volume_set_volume(device_t *device, float volume);
DECLARE_LEGACY_SOUND_DEVICE(FILTER_VOLUME, filter_volume);
class filter_volume_device : public device_t,
public device_sound_interface
{
public:
filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~filter_volume_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();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type FILTER_VOLUME;
#endif /* __FLT_VOL_H__ */

View File

@ -78,7 +78,7 @@ INLINE gaelco_sound_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == GAELCO_GAE1 || device->type() == GAELCO_CG1V);
return (gaelco_sound_state *)downcast<legacy_device_base *>(device)->token();
return (gaelco_sound_state *)downcast<gaelco_gae1_device *>(device)->token();
}
/*============================================================================
@ -339,5 +339,64 @@ DEVICE_GET_INFO( gaelco_cg1v )
}
DEFINE_LEGACY_SOUND_DEVICE(GAELCO_GAE1, gaelco_gae1);
DEFINE_LEGACY_SOUND_DEVICE(GAELCO_CG1V, gaelco_cg1v);
const device_type GAELCO_GAE1 = &device_creator<gaelco_gae1_device>;
gaelco_gae1_device::gaelco_gae1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, GAELCO_GAE1, "Gaelco GAE1", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(gaelco_sound_state));
}
gaelco_gae1_device::gaelco_gae1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, type, name, tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(gaelco_sound_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void gaelco_gae1_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void gaelco_gae1_device::device_start()
{
DEVICE_START_NAME( gaelco )(this);
}
//-------------------------------------------------
// device_stop - device-specific stop
//-------------------------------------------------
void gaelco_gae1_device::device_stop()
{
DEVICE_STOP_NAME( gaelco )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void gaelco_gae1_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}
const device_type GAELCO_CG1V = &device_creator<gaelco_cg1v_device>;
gaelco_cg1v_device::gaelco_cg1v_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: gaelco_gae1_device(mconfig, GAELCO_CG1V, "Gaelco CG1V", tag, owner, clock)
{
}

View File

@ -15,7 +15,38 @@ struct _gaelcosnd_interface
WRITE16_DEVICE_HANDLER( gaelcosnd_w );
READ16_DEVICE_HANDLER( gaelcosnd_r );
DECLARE_LEGACY_SOUND_DEVICE(GAELCO_GAE1, gaelco_gae1);
DECLARE_LEGACY_SOUND_DEVICE(GAELCO_CG1V, gaelco_cg1v);
class gaelco_gae1_device : public device_t,
public device_sound_interface
{
public:
gaelco_gae1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
gaelco_gae1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
~gaelco_gae1_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_stop();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type GAELCO_GAE1;
class gaelco_cg1v_device : public gaelco_gae1_device
{
public:
gaelco_cg1v_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
extern const device_type GAELCO_CG1V;
#endif /* __GALELCO_H__ */

View File

@ -57,7 +57,7 @@ INLINE hc55516_state *get_safe_token(device_t *device)
assert(device->type() == HC55516 ||
device->type() == MC3417 ||
device->type() == MC3418);
return (hc55516_state *)downcast<legacy_device_base *>(device)->token();
return (hc55516_state *)downcast<hc55516_device *>(device)->token();
}
@ -344,6 +344,111 @@ DEVICE_GET_INFO( mc3418 )
}
DEFINE_LEGACY_SOUND_DEVICE(HC55516, hc55516);
DEFINE_LEGACY_SOUND_DEVICE(MC3417, mc3417);
DEFINE_LEGACY_SOUND_DEVICE(MC3418, mc3418);
const device_type HC55516 = &device_creator<hc55516_device>;
hc55516_device::hc55516_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, HC55516, "HC-55516", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(hc55516_state));
}
hc55516_device::hc55516_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, type, name, tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(hc55516_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void hc55516_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void hc55516_device::device_start()
{
DEVICE_START_NAME( hc55516 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void hc55516_device::device_reset()
{
DEVICE_RESET_NAME( hc55516 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void hc55516_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}
const device_type MC3417 = &device_creator<mc3417_device>;
mc3417_device::mc3417_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: hc55516_device(mconfig, MC3417, "MC3417", tag, owner, clock)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void mc3417_device::device_start()
{
DEVICE_START_NAME( mc3417 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void mc3417_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}
const device_type MC3418 = &device_creator<mc3418_device>;
mc3418_device::mc3418_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: hc55516_device(mconfig, MC3418, "MC3418", tag, owner, clock)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void mc3418_device::device_start()
{
DEVICE_START_NAME( mc3418 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void mc3418_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -15,8 +15,58 @@ void hc55516_clock_w(device_t *device, int state);
/* returns whether the clock is currently LO or HI */
int hc55516_clock_state_r(device_t *device);
DECLARE_LEGACY_SOUND_DEVICE(HC55516, hc55516);
DECLARE_LEGACY_SOUND_DEVICE(MC3417, mc3417);
DECLARE_LEGACY_SOUND_DEVICE(MC3418, mc3418);
class hc55516_device : public device_t,
public device_sound_interface
{
public:
hc55516_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
hc55516_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
~hc55516_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();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type HC55516;
class mc3417_device : public hc55516_device
{
public:
mc3417_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
// device-level overrides
virtual void device_start();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
};
extern const device_type MC3417;
class mc3418_device : public hc55516_device
{
public:
mc3418_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
// device-level overrides
virtual void device_start();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
};
extern const device_type MC3418;
#endif /* __HC55516_H__ */

View File

@ -60,7 +60,7 @@ INLINE ga20_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == IREMGA20);
return (ga20_state *)downcast<legacy_device_base *>(device)->token();
return (ga20_state *)downcast<iremga20_device *>(device)->token();
}
@ -293,4 +293,51 @@ DEVICE_GET_INFO( iremga20 )
}
DEFINE_LEGACY_SOUND_DEVICE(IREMGA20, iremga20);
const device_type IREMGA20 = &device_creator<iremga20_device>;
iremga20_device::iremga20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, IREMGA20, "Irem GA20", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(ga20_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void iremga20_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void iremga20_device::device_start()
{
DEVICE_START_NAME( iremga20 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void iremga20_device::device_reset()
{
DEVICE_RESET_NAME( iremga20 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void iremga20_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -13,6 +13,29 @@
WRITE8_DEVICE_HANDLER( irem_ga20_w );
READ8_DEVICE_HANDLER( irem_ga20_r );
DECLARE_LEGACY_SOUND_DEVICE(IREMGA20, iremga20);
class iremga20_device : public device_t,
public device_sound_interface
{
public:
iremga20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~iremga20_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();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type IREMGA20;
#endif /* __IREMGA20_H__ */

View File

@ -64,7 +64,7 @@ INLINE k005289_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == K005289);
return (k005289_state *)downcast<legacy_device_base *>(device)->token();
return (k005289_state *)downcast<k005289_device *>(device)->token();
}
/* build a table to divide by the number of voices */
@ -274,4 +274,42 @@ DEVICE_GET_INFO( k005289 )
}
DEFINE_LEGACY_SOUND_DEVICE(K005289, k005289);
const device_type K005289 = &device_creator<k005289_device>;
k005289_device::k005289_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, K005289, "K005289", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(k005289_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void k005289_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void k005289_device::device_start()
{
DEVICE_START_NAME( k005289 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void k005289_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -12,6 +12,28 @@ WRITE8_DEVICE_HANDLER( k005289_pitch_B_w );
WRITE8_DEVICE_HANDLER( k005289_keylatch_A_w );
WRITE8_DEVICE_HANDLER( k005289_keylatch_B_w );
DECLARE_LEGACY_SOUND_DEVICE(K005289, k005289);
class k005289_device : public device_t,
public device_sound_interface
{
public:
k005289_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~k005289_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();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type K005289;
#endif /* __K005289_H__ */

View File

@ -58,7 +58,7 @@ INLINE KDAC_A_PCM *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == K007232);
return (KDAC_A_PCM *)downcast<legacy_device_base *>(device)->token();
return (KDAC_A_PCM *)downcast<k007232_device *>(device)->token();
}
@ -473,4 +473,42 @@ DEVICE_GET_INFO( k007232 )
}
DEFINE_LEGACY_SOUND_DEVICE(K007232, k007232);
const device_type K007232 = &device_creator<k007232_device>;
k007232_device::k007232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, K007232, "K007232", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(KDAC_A_PCM));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void k007232_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void k007232_device::device_start()
{
DEVICE_START_NAME( k007232 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void k007232_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -30,6 +30,28 @@ void k007232_set_bank( device_t *device, int chABank, int chBBank );
*/
void k007232_set_volume(device_t *device,int channel,int volumeA,int volumeB);
DECLARE_LEGACY_SOUND_DEVICE(K007232, k007232);
class k007232_device : public device_t,
public device_sound_interface
{
public:
k007232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~k007232_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();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type K007232;
#endif /* __K007232_H__ */

View File

@ -61,7 +61,7 @@ INLINE k051649_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == K051649);
return (k051649_state *)downcast<legacy_device_base *>(device)->token();
return (k051649_state *)downcast<k051649_device *>(device)->token();
}
/* build a table to divide by the number of voices */
@ -310,4 +310,51 @@ DEVICE_GET_INFO( k051649 )
}
DEFINE_LEGACY_SOUND_DEVICE(K051649, k051649);
const device_type K051649 = &device_creator<k051649_device>;
k051649_device::k051649_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, K051649, "K051649", tag, owner, clock),
device_sound_interface(mconfig, *this)
{
m_token = global_alloc_array_clear(UINT8, sizeof(k051649_state));
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void k051649_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void k051649_device::device_start()
{
DEVICE_START_NAME( k051649 )(this);
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void k051649_device::device_reset()
{
DEVICE_RESET_NAME( k051649 )(this);
}
//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------
void k051649_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
// should never get here
fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
}

View File

@ -16,6 +16,29 @@ READ8_DEVICE_HANDLER ( k051649_test_r );
WRITE8_DEVICE_HANDLER( k052539_waveform_w );
READ8_DEVICE_HANDLER ( k052539_waveform_r );
DECLARE_LEGACY_SOUND_DEVICE(K051649, k051649);
class k051649_device : public device_t,
public device_sound_interface
{
public:
k051649_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~k051649_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();
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
void *m_token;
};
extern const device_type K051649;
#endif /* __K051649_H__ */

Some files were not shown because too many files have changed in this diff Show More