-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfm_opll.h
247 lines (226 loc) · 4.72 KB
/
fm_opll.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
#pragma once
typedef struct {
int mclk;
int cs;
int we;
int a0;
int ic;
int in_data;
} fmopll_input_t;
typedef struct {
int tl;
int dc;
int dm;
int fb;
int am[2];
int vib[2];
int et[2];
int ksr[2];
int multi[2];
int ksl[2];
int ar[2];
int dr[2];
int sl[2];
int rr[2];
} fmopll_patch_t;
typedef struct {
int tl;
int dc;
int dm;
int fb;
int am;
int vib;
int et;
int ksr;
int multi;
int ksl;
int ar;
int dr;
int sl;
int rr;
} fmopll_patch_cur_t;
typedef struct {
// input
fmopll_input_t input, o_input;
int ic_latch[2];
int ic_latch2[2];
int prescaler_cnt[2];
int clk1_latch[3];
int clk1;
int clk2_latch[3];
int clk2;
int clk_dac_latch;
int clk_dac;
int data_latch;
int write_sr0;
int write_sr1;
int write0_latch[5];
int write1_latch[5];
int write0;
int write1;
int fsm_cnt1[2];
int fsm_cnt2[2];
int fsm_cnt_latch1[2];
int fsm_cnt_latch2[2];
int fsm_cnt_latch3[2];
int fsm_out[14];
int rclk_latch;
int rclk1;
int rclk2;
int reg_write[8][2];
int reg_write_rhy[2];
int reg_write_test[2];
fmopll_patch_t patch;
int rhythm;
int rhythm_kon;
int testmode;
int update_chan_regs;
int chan_reg_addr;
int chan_data;
int update_chan_latch[2];
int chan_cnt[2];
int chan_fnum[9][2];
int chan_block[3][2];
int chan_kon[2];
int chan_son[2];
int chan_volume[4][2];
int chan_inst[4][2];
int fnum;
int block;
int kon;
int son;
int inst;
int volume;
int volume_latch1;
int volume_latch2;
int force_zerorate;
int rhythm_sel[2];
int inst0_sel;
int modcar_sel_latch;
int kon_latch;
int hh_tom_latch;
fmopll_patch_cur_t patch_latch[2];
fmopll_patch_cur_t patch_cur;
int fnum_latch[2];
int block_latch[2];
int multi_latch;
int sl_latch;
int fb_latch;
int tremolo_latch;
int vibrato_latch;
int dc_latch[2];
int dm_latch[2];
int lfo_cnt[2];
int trem_step;
int trem_step_latch;
int vib_cnt[2];
int fnum_vib;
int freq_multi[2];
int pg_phase_latch[2];
int pg_phase[19][2];
int pg_reset_latch[2];
int mc_latch[2];
int eg_dokon[2];
int debug_out[2][2];
int pg_out;
int lfsr[2];
int noise_bit;
int hh_load;
int tc_load;
int hh_bit2;
int hh_bit3;
int hh_bit7;
int hh_bit8;
int tc_bit3;
int tc_bit5;
int kon_comb;
int trem_load1;
int trem_load2;
int trem_dir[2];
int trem_sr[2];
int trem_cb[2];
int trem_out;
int eg_timer_sr[2];
int eg_timer_sr_masked[2];
int eg_timer_bit_latch[2];
int eg_timer_mask[2];
int eg_ic_latch[2];
int eg_sync_latch[2];
int eg_timer_prescaler[2];
int eg_subcnt1_latch[2];
int eg_subcnt2_latch;
int eg_timer_load;
int eg_timer_carry[2];
int eg_timer_low;
int eg_shift;
int eg_state[2][2];
int eg_level[7][2];
int eg_off;
int eg_kon_latch[2];
int eg_off_latch[2];
int eg_ratesel;
int eg_isrelease;
int eg_resetlevel;
int eg_instantattack;
int eg_slreach;
int eg_zeroreach;
int eg_expstep;
int eg_linstep;
int eg_sllatch[2];
int eg_ksr_freq;
int eg_ksr_low[3];
int eg_ksr_high;
int eg_rate_latch;
int eg_son_latch;
int eg_rate1;
int eg_kon_latch2;
int eg_isrelease_notoff;
int eg_son_latch2;
int eg_zerorate[3];
int eg_rate_latch2;
int eg_rate_latch3;
int eg_rate_high;
int eg_rate_12;
int eg_rate_13;
int eg_rate_14;
int eg_rate_15;
int eg_shift_latch;
int eg_subcnt1_latch2;
int eg_subcnt2_latch2;
int eg_step_hi;
int eg_step1;
int eg_step2;
int eg_step3;
int eg_step4;
int eg_ksllatch;
int eg_ksltl;
int eg_ksltltrem;
int eg_level_latch;
int eg_out;
int eg_silent[2];
int op_logsin_add_delta;
int op_logsin_base;
int op_logsin_delta;
int op_logsin;
int op_shift[2];
int op_pow_add_delta;
int op_pow_base;
int op_pow_delta;
int op_pow;
int op_sign[2];
int op_fb[2][12][2];
int op_mod[2];
int op_fbmod[2];
int op_modenable[2];
int op_out;
int ch_out[2];
int ch_rhysr[9][2];
int ch_m_en[2];
int ch_r_en[2];
int ch_debug[2];
int out_m;
int out_r;
int oclk1;
int oclk2;
} fm_opll_t;
void FMOPLL_Clock2(fm_opll_t *chip);