diff options
author | 2015-09-13 08:41:44 +0200 | |
---|---|---|
committer | 2015-09-13 08:41:44 +0200 | |
commit | f88cefad27a1737c76e09d99c9fb43e173506081 (patch) | |
tree | 2d8167d03579c46e226471747eb4407bd00ed6fa /src/devices/sound/astrocde.h | |
parent | e92ac9e0fa8e99869894bea00589bbb526be30aa (diff) |
Move all devices into separate part of src tree (nw)
Diffstat (limited to 'src/devices/sound/astrocde.h')
-rw-r--r-- | src/devices/sound/astrocde.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/src/devices/sound/astrocde.h b/src/devices/sound/astrocde.h new file mode 100644 index 00000000000..23e9a83c733 --- /dev/null +++ b/src/devices/sound/astrocde.h @@ -0,0 +1,73 @@ +// license:BSD-3-Clause +// copyright-holders:Aaron Giles,Frank Palazzolo +#pragma once + +#ifndef __ASTROCDE_H__ +#define __ASTROCDE_H__ + + +//************************************************************************** +// INTERFACE CONFIGURATION MACROS +//************************************************************************** + +#define MCFG_ASTROCADE_ADD(_tag, _clock) \ + MCFG_DEVICE_ADD(_tag, ASTROCADE, _clock) +#define MCFG_ASTROCADE_REPLACE(_tag, _clock) \ + MCFG_DEVICE_REPLACE(_tag, ASTROCADE, _clock) + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> astrocade_device + +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() { } + +protected: + // device-level overrides + 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); + +public: + DECLARE_WRITE8_MEMBER( astrocade_sound_w ); + +private: + void state_save_register(); + +private: + sound_stream *m_stream; /* sound stream */ + + UINT8 m_reg[8]; /* 8 control registers */ + + UINT8 m_master_count; /* current master oscillator count */ + UINT16 m_vibrato_clock; /* current vibrato clock */ + + UINT8 m_noise_clock; /* current noise generator clock */ + UINT16 m_noise_state; /* current noise LFSR state */ + + UINT8 m_a_count; /* current tone generator A count */ + UINT8 m_a_state; /* current tone generator A state */ + + UINT8 m_b_count; /* current tone generator B count */ + UINT8 m_b_state; /* current tone generator B state */ + + UINT8 m_c_count; /* current tone generator C count */ + UINT8 m_c_state; /* current tone generator C state */ + + UINT8 m_bitswap[256]; /* bitswap table */ +}; + +extern const device_type ASTROCADE; + + +#endif /* __ASTROCDE_H__ */ |