comparison ym2612.c @ 377:da8d53dc914b

Initial stab at feedback
author Mike Pavone <pavone@retrodev.com>
date Sun, 02 Jun 2013 22:30:41 -0700
parents f6def5cdf1b4
children 92947faa258a
comparison
equal deleted inserted replaced
376:f6def5cdf1b4 377:da8d53dc914b
153 } 153 }
154 } 154 }
155 } 155 }
156 } 156 }
157 157
158 #define YM_VOLUME_DIVIDER 1 158 #define YM_VOLUME_DIVIDER 2
159 159
160 void ym_run(ym2612_context * context, uint32_t to_cycle) 160 void ym_run(ym2612_context * context, uint32_t to_cycle)
161 { 161 {
162 //printf("Running YM2612 from cycle %d to cycle %d\n", context->current_cycle, to_cycle); 162 //printf("Running YM2612 from cycle %d to cycle %d\n", context->current_cycle, to_cycle);
163 //TODO: Fix channel update order OR remap channels in register write 163 //TODO: Fix channel update order OR remap channels in register write
265 uint16_t phase = operator->phase_counter >> 10 & 0x3FF; 265 uint16_t phase = operator->phase_counter >> 10 & 0x3FF;
266 int16_t mod = 0; 266 int16_t mod = 0;
267 switch (op % 4) 267 switch (op % 4)
268 { 268 {
269 case 0://Operator 1 269 case 0://Operator 1
270 //TODO: Feedback 270 if (chan->feedback) {
271 mod = operator->output >> (10-chan->feedback);
272 }
271 break; 273 break;
272 case 1://Operator 3 274 case 1://Operator 3
273 switch(chan->algorithm) 275 switch(chan->algorithm)
274 { 276 {
275 case 0: 277 case 0: