summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/sound/cdp1864.h
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2011-04-27 05:11:18 +0000
committer Aaron Giles <aaron@aarongiles.com>2011-04-27 05:11:18 +0000
commit919913f118760c0ca41ab63512bd5c106f6fd840 (patch)
treecd6c115c8e9c5280ac4bd16eabfe69c7341151c2 /src/emu/sound/cdp1864.h
parent84f2c31f7d6f6c667427b1d60c83e6dc9f420d60 (diff)
Collapsed device_config and device_t into one class. Updated all
existing modern devices and the legacy wrappers to work in this environment. This in general greatly simplifies writing a modern device. [Aaron Giles] General notes: * some more cleanup probably needs to happen behind this change, but I needed to get it in before the next device modernization or import from MESS :) * new template function device_creator which automatically defines the static function that creates the device; use this instead of creating a static_alloc_device_config function * added device_stop() method which is called at around the time the previous device_t's destructor was called; if you auto_free anything, do it here because the machine is gone when the destructor is called * changed the static_set_* calls to pass a device_t & instead of a device_config * * for many devices, the static config structure member names over- lapped the device's names for devcb_* functions; in these cases the members in the interface were renamed to have a _cb suffix * changed the driver_enumerator to only cache 100 machine_configs because caching them all took a ton of memory; fortunately this implementation detail is completely hidden behind the driver_enumerator interface * got rid of the macros for creating derived classes; doing it manually is now clean enough that it isn't worth hiding the details in a macro
Diffstat (limited to 'src/emu/sound/cdp1864.h')
-rw-r--r--src/emu/sound/cdp1864.h51
1 files changed, 13 insertions, 38 deletions
diff --git a/src/emu/sound/cdp1864.h b/src/emu/sound/cdp1864.h
index aa938c89c93..09d6d9d161f 100644
--- a/src/emu/sound/cdp1864.h
+++ b/src/emu/sound/cdp1864.h
@@ -115,16 +115,16 @@ struct cdp1864_interface
const char *m_cpu_tag;
const char *m_screen_tag;
- devcb_read_line m_in_inlace_func;
+ devcb_read_line m_in_inlace_cb;
- devcb_read_line m_in_rdata_func;
- devcb_read_line m_in_bdata_func;
- devcb_read_line m_in_gdata_func;
+ devcb_read_line m_in_rdata_cb;
+ devcb_read_line m_in_bdata_cb;
+ devcb_read_line m_in_gdata_cb;
- devcb_write_line m_out_int_func;
- devcb_write_line m_out_dmao_func;
- devcb_write_line m_out_efx_func;
- devcb_write_line m_out_hsync_func;
+ devcb_write_line m_out_int_cb;
+ devcb_write_line m_out_dmao_cb;
+ devcb_write_line m_out_efx_cb;
+ devcb_write_line m_out_hsync_cb;
double m_res_r; // red output resistor value
double m_res_g; // green output resistor value
@@ -134,40 +134,16 @@ struct cdp1864_interface
-// ======================> cdp1864_device_config
-
-class cdp1864_device_config : public device_config,
- public device_config_sound_interface,
- public cdp1864_interface
-{
- friend class cdp1864_device;
-
- // construction/destruction
- cdp1864_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-};
-
-
-
// ======================> cdp1864_device
class cdp1864_device : public device_t,
- public device_sound_interface
+ public device_sound_interface,
+ public cdp1864_interface
{
- friend class cdp1864_device_config;
-
+public:
// construction/destruction
- cdp1864_device(running_machine &_machine, const cdp1864_device_config &_config);
+ cdp1864_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( dispon_r );
DECLARE_READ8_MEMBER( dispoff_r );
@@ -184,6 +160,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -230,8 +207,6 @@ private:
emu_timer *m_efx_timer;
emu_timer *m_dma_timer;
emu_timer *m_hsync_timer;
-
- const cdp1864_device_config &m_config;
};