trunk/src/mess/audio/dai.c
r32657 | r32658 | |
1 | | /*************************************************************************** |
2 | | |
3 | | audio/dai.c |
4 | | |
5 | | Functions to emulate sound hardware of DAI Personal Computer |
6 | | |
7 | | Krzysztof Strzecha |
8 | | |
9 | | ****************************************************************************/ |
10 | | |
11 | | #include "emu.h" |
12 | | #include "includes/dai.h" |
13 | | |
14 | | // device type definition |
15 | | const device_type DAI_SOUND = &device_creator<dai_sound_device>; |
16 | | |
17 | | |
18 | | //------------------------------------------------- |
19 | | // dai_sound_device - constructor |
20 | | //------------------------------------------------- |
21 | | |
22 | | dai_sound_device::dai_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
23 | | : device_t(mconfig, DAI_SOUND, "DAI Audio Custom", tag, owner, clock, "dai_sound", __FILE__), |
24 | | device_sound_interface(mconfig, *this) |
25 | | { |
26 | | } |
27 | | |
28 | | //------------------------------------------------- |
29 | | // device_start - device-specific startup |
30 | | //------------------------------------------------- |
31 | | |
32 | | void dai_sound_device::device_start() |
33 | | { |
34 | | m_mixer_channel = machine().sound().stream_alloc(*this, 0, 2, machine().sample_rate()); |
35 | | } |
36 | | |
37 | | //------------------------------------------------- |
38 | | // device_reset - device-specific reset |
39 | | //------------------------------------------------- |
40 | | |
41 | | void dai_sound_device::device_reset() |
42 | | { |
43 | | memset(m_dai_input, 0, sizeof(m_dai_input)); |
44 | | memset(m_osc_volume, 0, sizeof(m_osc_volume)); |
45 | | m_noise_volume = 0; |
46 | | } |
47 | | |
48 | | |
49 | | //------------------------------------------------- |
50 | | // channels 0/1/2 volume table |
51 | | //------------------------------------------------- |
52 | | |
53 | | const UINT16 dai_sound_device::s_osc_volume_table[] = { |
54 | | 0, 500, 1000, 1500, |
55 | | 2000, 2500, 3000, 3500, |
56 | | 4000, 4500, 5000, 5500, |
57 | | 6000, 6500, 7000, 7500 |
58 | | }; |
59 | | |
60 | | //------------------------------------------------- |
61 | | // noise volume table |
62 | | //------------------------------------------------- |
63 | | |
64 | | const UINT16 dai_sound_device::s_noise_volume_table[] = { |
65 | | 0, 0, 0, 0, |
66 | | 0, 0, 0, 0, |
67 | | 500, 1000, 1500, 2000, |
68 | | 2500, 3000, 3500, 4000 |
69 | | }; |
70 | | |
71 | | |
72 | | //------------------------------------------------- |
73 | | // set_volume |
74 | | //------------------------------------------------- |
75 | | |
76 | | WRITE8_MEMBER(dai_sound_device::set_volume) |
77 | | { |
78 | | m_mixer_channel->update(); |
79 | | |
80 | | switch (offset & 1) |
81 | | { |
82 | | case 0x00: |
83 | | m_osc_volume[0] = data&0x0f; |
84 | | m_osc_volume[1] = (data&0xf0)>>4; |
85 | | break; |
86 | | |
87 | | case 0x01: |
88 | | m_osc_volume[2] = data&0x0f; |
89 | | m_noise_volume = (data&0xf0)>>4; |
90 | | } |
91 | | } |
92 | | |
93 | | //------------------------------------------------- |
94 | | // PIT callbacks |
95 | | //------------------------------------------------- |
96 | | |
97 | | WRITE_LINE_MEMBER(dai_sound_device::set_input_ch0) |
98 | | { |
99 | | m_mixer_channel->update(); |
100 | | m_dai_input[0] = state; |
101 | | } |
102 | | |
103 | | WRITE_LINE_MEMBER(dai_sound_device::set_input_ch1) |
104 | | { |
105 | | m_mixer_channel->update(); |
106 | | m_dai_input[1] = state; |
107 | | } |
108 | | |
109 | | WRITE_LINE_MEMBER(dai_sound_device::set_input_ch2) |
110 | | { |
111 | | m_mixer_channel->update(); |
112 | | m_dai_input[2] = state; |
113 | | } |
114 | | |
115 | | //------------------------------------------------- |
116 | | // sound_stream_update - handle update requests for |
117 | | // our sound stream |
118 | | //------------------------------------------------- |
119 | | |
120 | | void dai_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) |
121 | | { |
122 | | stream_sample_t *sample_left = outputs[0]; |
123 | | stream_sample_t *sample_right = outputs[1]; |
124 | | |
125 | | INT16 channel_0_signal = m_dai_input[0] ? s_osc_volume_table[m_osc_volume[0]] : -s_osc_volume_table[m_osc_volume[0]]; |
126 | | INT16 channel_1_signal = m_dai_input[1] ? s_osc_volume_table[m_osc_volume[1]] : -s_osc_volume_table[m_osc_volume[1]]; |
127 | | INT16 channel_2_signal = m_dai_input[2] ? s_osc_volume_table[m_osc_volume[2]] : -s_osc_volume_table[m_osc_volume[2]]; |
128 | | |
129 | | while (samples--) |
130 | | { |
131 | | INT16 noise = machine().rand()&0x01 ? s_noise_volume_table[m_noise_volume] : -s_noise_volume_table[m_noise_volume]; |
132 | | |
133 | | /* channel 0 + channel 1 + noise */ |
134 | | *sample_left++ = channel_0_signal + channel_1_signal + noise; |
135 | | |
136 | | /* channel 1 + channel 2 + noise */ |
137 | | *sample_right++ = channel_1_signal + channel_2_signal + noise; |
138 | | } |
139 | | } |
trunk/src/mess/audio/special.c
r32657 | r32658 | |
1 | | /*************************************************************************** |
2 | | |
3 | | audio/special.c |
4 | | |
5 | | Functions to emulate sound hardware of Specialist MX |
6 | | ( based on code of DAI interface ) |
7 | | |
8 | | ****************************************************************************/ |
9 | | |
10 | | #include "includes/special.h" |
11 | | |
12 | | |
13 | | // device type definition |
14 | | const device_type SPECIMX = &device_creator<specimx_sound_device>; |
15 | | |
16 | | |
17 | | //************************************************************************** |
18 | | // LIVE DEVICE |
19 | | //************************************************************************** |
20 | | |
21 | | //------------------------------------------------- |
22 | | // specimx_sound_device - constructor |
23 | | //------------------------------------------------- |
24 | | |
25 | | specimx_sound_device::specimx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
26 | | : device_t(mconfig, SPECIMX, "Specialist MX Audio Custom", tag, owner, clock, "specimx_sound", __FILE__), |
27 | | device_sound_interface(mconfig, *this), |
28 | | m_mixer_channel(NULL) |
29 | | { |
30 | | memset(m_specimx_input, 0, sizeof(int)*3); |
31 | | } |
32 | | |
33 | | |
34 | | //------------------------------------------------- |
35 | | // device_start - device-specific startup |
36 | | //------------------------------------------------- |
37 | | |
38 | | void specimx_sound_device::device_start() |
39 | | { |
40 | | m_specimx_input[0] = m_specimx_input[1] = m_specimx_input[2] = 0; |
41 | | m_mixer_channel = stream_alloc(0, 1, machine().sample_rate()); |
42 | | } |
43 | | |
44 | | |
45 | | //------------------------------------------------- |
46 | | // sound_stream_update - handle a stream update |
47 | | //------------------------------------------------- |
48 | | |
49 | | void specimx_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) |
50 | | { |
51 | | INT16 channel_0_signal; |
52 | | INT16 channel_1_signal; |
53 | | INT16 channel_2_signal; |
54 | | |
55 | | stream_sample_t *sample_left = outputs[0]; |
56 | | |
57 | | channel_0_signal = m_specimx_input[0] ? 3000 : -3000; |
58 | | channel_1_signal = m_specimx_input[1] ? 3000 : -3000; |
59 | | channel_2_signal = m_specimx_input[2] ? 3000 : -3000; |
60 | | |
61 | | while (samples--) |
62 | | { |
63 | | *sample_left = 0; |
64 | | |
65 | | /* music channel 0 */ |
66 | | *sample_left += channel_0_signal; |
67 | | |
68 | | /* music channel 1 */ |
69 | | *sample_left += channel_1_signal; |
70 | | |
71 | | /* music channel 2 */ |
72 | | *sample_left += channel_2_signal; |
73 | | |
74 | | sample_left++; |
75 | | } |
76 | | } |
77 | | |
78 | | |
79 | | //------------------------------------------------- |
80 | | // PIT callbacks |
81 | | //------------------------------------------------- |
82 | | |
83 | | WRITE_LINE_MEMBER(specimx_sound_device::set_input_ch0) |
84 | | { |
85 | | m_mixer_channel->update(); |
86 | | m_specimx_input[0] = state; |
87 | | } |
88 | | |
89 | | WRITE_LINE_MEMBER(specimx_sound_device::set_input_ch1) |
90 | | { |
91 | | m_mixer_channel->update(); |
92 | | m_specimx_input[1] = state; |
93 | | } |
94 | | |
95 | | WRITE_LINE_MEMBER(specimx_sound_device::set_input_ch2) |
96 | | { |
97 | | m_mixer_channel->update(); |
98 | | m_specimx_input[2] = state; |
99 | | } |
trunk/src/mess/audio/dai_snd.c
r0 | r32658 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | audio/dai_snd.c |
| 4 | |
| 5 | Functions to emulate sound hardware of DAI Personal Computer |
| 6 | |
| 7 | Krzysztof Strzecha |
| 8 | |
| 9 | ****************************************************************************/ |
| 10 | |
| 11 | #include "emu.h" |
| 12 | #include "dai_snd.h" |
| 13 | |
| 14 | // device type definition |
| 15 | const device_type DAI_SOUND = &device_creator<dai_sound_device>; |
| 16 | |
| 17 | |
| 18 | //------------------------------------------------- |
| 19 | // dai_sound_device - constructor |
| 20 | //------------------------------------------------- |
| 21 | |
| 22 | dai_sound_device::dai_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 23 | : device_t(mconfig, DAI_SOUND, "DAI Audio Custom", tag, owner, clock, "dai_sound", __FILE__), |
| 24 | device_sound_interface(mconfig, *this) |
| 25 | { |
| 26 | } |
| 27 | |
| 28 | //------------------------------------------------- |
| 29 | // device_start - device-specific startup |
| 30 | //------------------------------------------------- |
| 31 | |
| 32 | void dai_sound_device::device_start() |
| 33 | { |
| 34 | m_mixer_channel = machine().sound().stream_alloc(*this, 0, 2, machine().sample_rate()); |
| 35 | } |
| 36 | |
| 37 | //------------------------------------------------- |
| 38 | // device_reset - device-specific reset |
| 39 | //------------------------------------------------- |
| 40 | |
| 41 | void dai_sound_device::device_reset() |
| 42 | { |
| 43 | memset(m_dai_input, 0, sizeof(m_dai_input)); |
| 44 | memset(m_osc_volume, 0, sizeof(m_osc_volume)); |
| 45 | m_noise_volume = 0; |
| 46 | } |
| 47 | |
| 48 | |
| 49 | //------------------------------------------------- |
| 50 | // channels 0/1/2 volume table |
| 51 | //------------------------------------------------- |
| 52 | |
| 53 | const UINT16 dai_sound_device::s_osc_volume_table[] = { |
| 54 | 0, 500, 1000, 1500, |
| 55 | 2000, 2500, 3000, 3500, |
| 56 | 4000, 4500, 5000, 5500, |
| 57 | 6000, 6500, 7000, 7500 |
| 58 | }; |
| 59 | |
| 60 | //------------------------------------------------- |
| 61 | // noise volume table |
| 62 | //------------------------------------------------- |
| 63 | |
| 64 | const UINT16 dai_sound_device::s_noise_volume_table[] = { |
| 65 | 0, 0, 0, 0, |
| 66 | 0, 0, 0, 0, |
| 67 | 500, 1000, 1500, 2000, |
| 68 | 2500, 3000, 3500, 4000 |
| 69 | }; |
| 70 | |
| 71 | |
| 72 | //------------------------------------------------- |
| 73 | // set_volume |
| 74 | //------------------------------------------------- |
| 75 | |
| 76 | WRITE8_MEMBER(dai_sound_device::set_volume) |
| 77 | { |
| 78 | m_mixer_channel->update(); |
| 79 | |
| 80 | switch (offset & 1) |
| 81 | { |
| 82 | case 0x00: |
| 83 | m_osc_volume[0] = data&0x0f; |
| 84 | m_osc_volume[1] = (data&0xf0)>>4; |
| 85 | break; |
| 86 | |
| 87 | case 0x01: |
| 88 | m_osc_volume[2] = data&0x0f; |
| 89 | m_noise_volume = (data&0xf0)>>4; |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | //------------------------------------------------- |
| 94 | // PIT callbacks |
| 95 | //------------------------------------------------- |
| 96 | |
| 97 | WRITE_LINE_MEMBER(dai_sound_device::set_input_ch0) |
| 98 | { |
| 99 | m_mixer_channel->update(); |
| 100 | m_dai_input[0] = state; |
| 101 | } |
| 102 | |
| 103 | WRITE_LINE_MEMBER(dai_sound_device::set_input_ch1) |
| 104 | { |
| 105 | m_mixer_channel->update(); |
| 106 | m_dai_input[1] = state; |
| 107 | } |
| 108 | |
| 109 | WRITE_LINE_MEMBER(dai_sound_device::set_input_ch2) |
| 110 | { |
| 111 | m_mixer_channel->update(); |
| 112 | m_dai_input[2] = state; |
| 113 | } |
| 114 | |
| 115 | //------------------------------------------------- |
| 116 | // sound_stream_update - handle update requests for |
| 117 | // our sound stream |
| 118 | //------------------------------------------------- |
| 119 | |
| 120 | void dai_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) |
| 121 | { |
| 122 | stream_sample_t *sample_left = outputs[0]; |
| 123 | stream_sample_t *sample_right = outputs[1]; |
| 124 | |
| 125 | INT16 channel_0_signal = m_dai_input[0] ? s_osc_volume_table[m_osc_volume[0]] : -s_osc_volume_table[m_osc_volume[0]]; |
| 126 | INT16 channel_1_signal = m_dai_input[1] ? s_osc_volume_table[m_osc_volume[1]] : -s_osc_volume_table[m_osc_volume[1]]; |
| 127 | INT16 channel_2_signal = m_dai_input[2] ? s_osc_volume_table[m_osc_volume[2]] : -s_osc_volume_table[m_osc_volume[2]]; |
| 128 | |
| 129 | while (samples--) |
| 130 | { |
| 131 | INT16 noise = machine().rand()&0x01 ? s_noise_volume_table[m_noise_volume] : -s_noise_volume_table[m_noise_volume]; |
| 132 | |
| 133 | /* channel 0 + channel 1 + noise */ |
| 134 | *sample_left++ = channel_0_signal + channel_1_signal + noise; |
| 135 | |
| 136 | /* channel 1 + channel 2 + noise */ |
| 137 | *sample_right++ = channel_1_signal + channel_2_signal + noise; |
| 138 | } |
| 139 | } |
trunk/src/mess/audio/dai_snd.h
r0 | r32658 | |
| 1 | /***************************************************************************** |
| 2 | * |
| 3 | * dai_snd.h |
| 4 | * |
| 5 | ****************************************************************************/ |
| 6 | |
| 7 | #ifndef DAI_SND_H_ |
| 8 | #define DAI_SND_H_ |
| 9 | |
| 10 | #include "emu.h" |
| 11 | |
| 12 | // ======================> dai_sound_device |
| 13 | |
| 14 | class dai_sound_device : public device_t, |
| 15 | public device_sound_interface |
| 16 | { |
| 17 | public: |
| 18 | // construction/destruction |
| 19 | dai_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 20 | |
| 21 | DECLARE_WRITE_LINE_MEMBER(set_input_ch0); |
| 22 | DECLARE_WRITE_LINE_MEMBER(set_input_ch1); |
| 23 | DECLARE_WRITE_LINE_MEMBER(set_input_ch2); |
| 24 | DECLARE_WRITE8_MEMBER(set_volume); |
| 25 | |
| 26 | protected: |
| 27 | // device-level overrides |
| 28 | virtual void device_start(); |
| 29 | virtual void device_reset(); |
| 30 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); |
| 31 | |
| 32 | private: |
| 33 | sound_stream * m_mixer_channel; |
| 34 | int m_dai_input[3]; |
| 35 | UINT8 m_osc_volume[3]; |
| 36 | UINT8 m_noise_volume; |
| 37 | |
| 38 | static const UINT16 s_osc_volume_table[]; |
| 39 | static const UINT16 s_noise_volume_table[]; |
| 40 | }; |
| 41 | |
| 42 | extern const device_type DAI_SOUND; |
| 43 | |
| 44 | #endif /* DAI_H_ */ |
trunk/src/mess/audio/specimx_snd.c
r0 | r32658 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | audio/special.c |
| 4 | |
| 5 | Functions to emulate sound hardware of Specialist MX |
| 6 | ( based on code of DAI interface ) |
| 7 | |
| 8 | ****************************************************************************/ |
| 9 | |
| 10 | #include "specimx_snd.h" |
| 11 | |
| 12 | |
| 13 | // device type definition |
| 14 | const device_type SPECIMX_SND = &device_creator<specimx_sound_device>; |
| 15 | |
| 16 | |
| 17 | //************************************************************************** |
| 18 | // LIVE DEVICE |
| 19 | //************************************************************************** |
| 20 | |
| 21 | //------------------------------------------------- |
| 22 | // specimx_sound_device - constructor |
| 23 | //------------------------------------------------- |
| 24 | |
| 25 | specimx_sound_device::specimx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 26 | : device_t(mconfig, SPECIMX_SND, "Specialist MX Audio Custom", tag, owner, clock, "specimx_sound", __FILE__), |
| 27 | device_sound_interface(mconfig, *this), |
| 28 | m_mixer_channel(NULL) |
| 29 | { |
| 30 | memset(m_specimx_input, 0, sizeof(int)*3); |
| 31 | } |
| 32 | |
| 33 | |
| 34 | //------------------------------------------------- |
| 35 | // device_start - device-specific startup |
| 36 | //------------------------------------------------- |
| 37 | |
| 38 | void specimx_sound_device::device_start() |
| 39 | { |
| 40 | m_specimx_input[0] = m_specimx_input[1] = m_specimx_input[2] = 0; |
| 41 | m_mixer_channel = stream_alloc(0, 1, machine().sample_rate()); |
| 42 | } |
| 43 | |
| 44 | |
| 45 | //------------------------------------------------- |
| 46 | // sound_stream_update - handle a stream update |
| 47 | //------------------------------------------------- |
| 48 | |
| 49 | void specimx_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) |
| 50 | { |
| 51 | INT16 channel_0_signal; |
| 52 | INT16 channel_1_signal; |
| 53 | INT16 channel_2_signal; |
| 54 | |
| 55 | stream_sample_t *sample_left = outputs[0]; |
| 56 | |
| 57 | channel_0_signal = m_specimx_input[0] ? 3000 : -3000; |
| 58 | channel_1_signal = m_specimx_input[1] ? 3000 : -3000; |
| 59 | channel_2_signal = m_specimx_input[2] ? 3000 : -3000; |
| 60 | |
| 61 | while (samples--) |
| 62 | { |
| 63 | *sample_left = 0; |
| 64 | |
| 65 | /* music channel 0 */ |
| 66 | *sample_left += channel_0_signal; |
| 67 | |
| 68 | /* music channel 1 */ |
| 69 | *sample_left += channel_1_signal; |
| 70 | |
| 71 | /* music channel 2 */ |
| 72 | *sample_left += channel_2_signal; |
| 73 | |
| 74 | sample_left++; |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | |
| 79 | //------------------------------------------------- |
| 80 | // PIT callbacks |
| 81 | //------------------------------------------------- |
| 82 | |
| 83 | WRITE_LINE_MEMBER(specimx_sound_device::set_input_ch0) |
| 84 | { |
| 85 | m_mixer_channel->update(); |
| 86 | m_specimx_input[0] = state; |
| 87 | } |
| 88 | |
| 89 | WRITE_LINE_MEMBER(specimx_sound_device::set_input_ch1) |
| 90 | { |
| 91 | m_mixer_channel->update(); |
| 92 | m_specimx_input[1] = state; |
| 93 | } |
| 94 | |
| 95 | WRITE_LINE_MEMBER(specimx_sound_device::set_input_ch2) |
| 96 | { |
| 97 | m_mixer_channel->update(); |
| 98 | m_specimx_input[2] = state; |
| 99 | } |
trunk/src/mess/audio/specimx_snd.h
r0 | r32658 | |
| 1 | /***************************************************************************** |
| 2 | * |
| 3 | * specimx_snd.h |
| 4 | * |
| 5 | ****************************************************************************/ |
| 6 | |
| 7 | #ifndef SPECIAL_SND_H_ |
| 8 | #define SPECIAL_SND_H_ |
| 9 | |
| 10 | #include "emu.h" |
| 11 | |
| 12 | class specimx_sound_device : public device_t, |
| 13 | public device_sound_interface |
| 14 | { |
| 15 | public: |
| 16 | specimx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 17 | ~specimx_sound_device() { } |
| 18 | |
| 19 | DECLARE_WRITE_LINE_MEMBER(set_input_ch0); |
| 20 | DECLARE_WRITE_LINE_MEMBER(set_input_ch1); |
| 21 | DECLARE_WRITE_LINE_MEMBER(set_input_ch2); |
| 22 | |
| 23 | protected: |
| 24 | // device-level overrides |
| 25 | virtual void device_start(); |
| 26 | |
| 27 | // sound stream update overrides |
| 28 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); |
| 29 | |
| 30 | private: |
| 31 | sound_stream *m_mixer_channel; |
| 32 | int m_specimx_input[3]; |
| 33 | }; |
| 34 | |
| 35 | extern const device_type SPECIMX_SND; |
| 36 | |
| 37 | #endif /* SPECIAL_SND_H_ */ |
trunk/src/mess/includes/special.h
r32657 | r32658 | |
10 | 10 | #include "emu.h" |
11 | 11 | #include "cpu/z80/z80.h" |
12 | 12 | #include "cpu/i8085/i8085.h" |
| 13 | #include "audio/specimx_snd.h" |
13 | 14 | #include "sound/dac.h" |
14 | 15 | #include "sound/wave.h" |
15 | 16 | #include "machine/i8255.h" |
r32657 | r32658 | |
21 | 22 | #include "machine/ram.h" |
22 | 23 | |
23 | 24 | |
24 | | class specimx_sound_device; // defined below |
25 | | |
26 | 25 | class special_state : public driver_device |
27 | 26 | { |
28 | 27 | public: |
r32657 | r32658 | |
154 | 153 | extern const rgb_t specimx_palette[16]; |
155 | 154 | |
156 | 155 | |
157 | | /*----------- defined in audio/special.c -----------*/ |
158 | | |
159 | | class specimx_sound_device : public device_t, |
160 | | public device_sound_interface |
161 | | { |
162 | | public: |
163 | | specimx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
164 | | ~specimx_sound_device() { } |
165 | | |
166 | | DECLARE_WRITE_LINE_MEMBER(set_input_ch0); |
167 | | DECLARE_WRITE_LINE_MEMBER(set_input_ch1); |
168 | | DECLARE_WRITE_LINE_MEMBER(set_input_ch2); |
169 | | |
170 | | protected: |
171 | | // device-level overrides |
172 | | virtual void device_start(); |
173 | | |
174 | | // sound stream update overrides |
175 | | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); |
176 | | |
177 | | private: |
178 | | sound_stream *m_mixer_channel; |
179 | | int m_specimx_input[3]; |
180 | | }; |
181 | | |
182 | | extern const device_type SPECIMX; |
183 | | |
184 | 156 | #endif /* SPECIAL_H_ */ |
trunk/src/mess/includes/dai.h
r32657 | r32658 | |
8 | 8 | #define DAI_H_ |
9 | 9 | |
10 | 10 | #include "cpu/i8085/i8085.h" |
| 11 | #include "audio/dai_snd.h" |
11 | 12 | #include "machine/i8255.h" |
12 | 13 | #include "machine/pit8253.h" |
13 | 14 | #include "machine/ram.h" |
r32657 | r32658 | |
16 | 17 | #include "sound/wave.h" |
17 | 18 | |
18 | 19 | |
19 | | // ======================> dai_sound_device |
20 | | |
21 | | class dai_sound_device : public device_t, |
22 | | public device_sound_interface |
23 | | { |
24 | | public: |
25 | | // construction/destruction |
26 | | dai_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
27 | | |
28 | | DECLARE_WRITE_LINE_MEMBER(set_input_ch0); |
29 | | DECLARE_WRITE_LINE_MEMBER(set_input_ch1); |
30 | | DECLARE_WRITE_LINE_MEMBER(set_input_ch2); |
31 | | DECLARE_WRITE8_MEMBER(set_volume); |
32 | | |
33 | | protected: |
34 | | // device-level overrides |
35 | | virtual void device_start(); |
36 | | virtual void device_reset(); |
37 | | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); |
38 | | |
39 | | private: |
40 | | sound_stream * m_mixer_channel; |
41 | | int m_dai_input[3]; |
42 | | UINT8 m_osc_volume[3]; |
43 | | UINT8 m_noise_volume; |
44 | | |
45 | | static const UINT16 s_osc_volume_table[]; |
46 | | static const UINT16 s_noise_volume_table[]; |
47 | | }; |
48 | | |
49 | | |
50 | | |
51 | 20 | class dai_state : public driver_device |
52 | 21 | { |
53 | 22 | public: |
r32657 | r32658 | |
107 | 76 | extern const unsigned char dai_palette[16*3]; |
108 | 77 | |
109 | 78 | |
110 | | /*----------- defined in audio/dai.c -----------*/ |
111 | | |
112 | | extern const device_type DAI_SOUND; |
113 | | |
114 | 79 | #endif /* DAI_H_ */ |