aboutsummaryrefslogtreecommitdiffstats
path: root/sound/drivers/opl3/opl3_drums.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/drivers/opl3/opl3_drums.c')
-rw-r--r--sound/drivers/opl3/opl3_drums.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/sound/drivers/opl3/opl3_drums.c b/sound/drivers/opl3/opl3_drums.c
index f26332680c19..73694380734a 100644
--- a/sound/drivers/opl3/opl3_drums.c
+++ b/sound/drivers/opl3/opl3_drums.c
@@ -45,7 +45,7 @@ static char snd_opl3_drum_table[47] =
45 OPL3_CYMBAL_ON, OPL3_CYMBAL_ON /* 80 - 81 */ 45 OPL3_CYMBAL_ON, OPL3_CYMBAL_ON /* 80 - 81 */
46}; 46};
47 47
48typedef struct snd_opl3_drum_voice { 48struct snd_opl3_drum_voice {
49 int voice; 49 int voice;
50 int op; 50 int op;
51 unsigned char am_vib; 51 unsigned char am_vib;
@@ -54,33 +54,34 @@ typedef struct snd_opl3_drum_voice {
54 unsigned char sustain_release; 54 unsigned char sustain_release;
55 unsigned char feedback_connection; 55 unsigned char feedback_connection;
56 unsigned char wave_select; 56 unsigned char wave_select;
57} snd_opl3_drum_voice_t; 57};
58 58
59typedef struct snd_opl3_drum_note { 59struct snd_opl3_drum_note {
60 int voice; 60 int voice;
61 unsigned char fnum; 61 unsigned char fnum;
62 unsigned char octave_f; 62 unsigned char octave_f;
63 unsigned char feedback_connection; 63 unsigned char feedback_connection;
64} snd_opl3_drum_note_t; 64};
65 65
66static snd_opl3_drum_voice_t bass_op0 = {6, 0, 0x00, 0x32, 0xf8, 0x66, 0x30, 0x00}; 66static struct snd_opl3_drum_voice bass_op0 = {6, 0, 0x00, 0x32, 0xf8, 0x66, 0x30, 0x00};
67static snd_opl3_drum_voice_t bass_op1 = {6, 1, 0x00, 0x03, 0xf6, 0x57, 0x30, 0x00}; 67static struct snd_opl3_drum_voice bass_op1 = {6, 1, 0x00, 0x03, 0xf6, 0x57, 0x30, 0x00};
68static snd_opl3_drum_note_t bass_note = {6, 0x90, 0x09}; 68static struct snd_opl3_drum_note bass_note = {6, 0x90, 0x09};
69 69
70static snd_opl3_drum_voice_t hihat = {7, 0, 0x00, 0x03, 0xf0, 0x06, 0x20, 0x00}; 70static struct snd_opl3_drum_voice hihat = {7, 0, 0x00, 0x03, 0xf0, 0x06, 0x20, 0x00};
71 71
72static snd_opl3_drum_voice_t snare = {7, 1, 0x00, 0x03, 0xf0, 0x07, 0x20, 0x02}; 72static struct snd_opl3_drum_voice snare = {7, 1, 0x00, 0x03, 0xf0, 0x07, 0x20, 0x02};
73static snd_opl3_drum_note_t snare_note = {7, 0xf4, 0x0d}; 73static struct snd_opl3_drum_note snare_note = {7, 0xf4, 0x0d};
74 74
75static snd_opl3_drum_voice_t tomtom = {8, 0, 0x02, 0x03, 0xf0, 0x06, 0x10, 0x00}; 75static struct snd_opl3_drum_voice tomtom = {8, 0, 0x02, 0x03, 0xf0, 0x06, 0x10, 0x00};
76static snd_opl3_drum_note_t tomtom_note = {8, 0xf4, 0x09}; 76static struct snd_opl3_drum_note tomtom_note = {8, 0xf4, 0x09};
77 77
78static snd_opl3_drum_voice_t cymbal = {8, 1, 0x04, 0x03, 0xf0, 0x06, 0x10, 0x00}; 78static struct snd_opl3_drum_voice cymbal = {8, 1, 0x04, 0x03, 0xf0, 0x06, 0x10, 0x00};
79 79
80/* 80/*
81 * set drum voice characteristics 81 * set drum voice characteristics
82 */ 82 */
83static void snd_opl3_drum_voice_set(opl3_t *opl3, snd_opl3_drum_voice_t *data) 83static void snd_opl3_drum_voice_set(struct snd_opl3 *opl3,
84 struct snd_opl3_drum_voice *data)
84{ 85{
85 unsigned char op_offset = snd_opl3_regmap[data->voice][data->op]; 86 unsigned char op_offset = snd_opl3_regmap[data->voice][data->op];
86 unsigned char voice_offset = data->voice; 87 unsigned char voice_offset = data->voice;
@@ -114,7 +115,8 @@ static void snd_opl3_drum_voice_set(opl3_t *opl3, snd_opl3_drum_voice_t *data)
114/* 115/*
115 * Set drum voice pitch 116 * Set drum voice pitch
116 */ 117 */
117static void snd_opl3_drum_note_set(opl3_t *opl3, snd_opl3_drum_note_t *data) 118static void snd_opl3_drum_note_set(struct snd_opl3 *opl3,
119 struct snd_opl3_drum_note *data)
118{ 120{
119 unsigned char voice_offset = data->voice; 121 unsigned char voice_offset = data->voice;
120 unsigned short opl3_reg; 122 unsigned short opl3_reg;
@@ -131,8 +133,9 @@ static void snd_opl3_drum_note_set(opl3_t *opl3, snd_opl3_drum_note_t *data)
131/* 133/*
132 * Set drum voice volume and position 134 * Set drum voice volume and position
133 */ 135 */
134static void snd_opl3_drum_vol_set(opl3_t *opl3, snd_opl3_drum_voice_t *data, 136static void snd_opl3_drum_vol_set(struct snd_opl3 *opl3,
135 int vel, snd_midi_channel_t *chan) 137 struct snd_opl3_drum_voice *data,
138 int vel, struct snd_midi_channel *chan)
136{ 139{
137 unsigned char op_offset = snd_opl3_regmap[data->voice][data->op]; 140 unsigned char op_offset = snd_opl3_regmap[data->voice][data->op];
138 unsigned char voice_offset = data->voice; 141 unsigned char voice_offset = data->voice;
@@ -159,7 +162,7 @@ static void snd_opl3_drum_vol_set(opl3_t *opl3, snd_opl3_drum_voice_t *data,
159/* 162/*
160 * Loads drum voices at init time 163 * Loads drum voices at init time
161 */ 164 */
162void snd_opl3_load_drums(opl3_t *opl3) 165void snd_opl3_load_drums(struct snd_opl3 *opl3)
163{ 166{
164 snd_opl3_drum_voice_set(opl3, &bass_op0); 167 snd_opl3_drum_voice_set(opl3, &bass_op0);
165 snd_opl3_drum_voice_set(opl3, &bass_op1); 168 snd_opl3_drum_voice_set(opl3, &bass_op1);
@@ -179,11 +182,11 @@ void snd_opl3_load_drums(opl3_t *opl3)
179/* 182/*
180 * Switch drum voice on or off 183 * Switch drum voice on or off
181 */ 184 */
182void snd_opl3_drum_switch(opl3_t *opl3, int note, int vel, int on_off, 185void snd_opl3_drum_switch(struct snd_opl3 *opl3, int note, int vel, int on_off,
183 snd_midi_channel_t *chan) 186 struct snd_midi_channel *chan)
184{ 187{
185 unsigned char drum_mask; 188 unsigned char drum_mask;
186 snd_opl3_drum_voice_t *drum_voice; 189 struct snd_opl3_drum_voice *drum_voice;
187 190
188 if (!(opl3->drum_reg & OPL3_PERCUSSION_ENABLE)) 191 if (!(opl3->drum_reg & OPL3_PERCUSSION_ENABLE))
189 return; 192 return;