| 443 | } |
| 444 | |
| 445 | void Rjp1::modulateVolumeWaveform(Rjp1Channel *channel) { |
| 446 | if (channel->modulateVolumeData) { |
| 447 | uint32 i = channel->modulateVolumeIndex; |
| 448 | channel->volume += channel->modulateVolumeData[i] * channel->volume / 128; |
| 449 | ++i; |
| 450 | if (i == channel->modulateVolumeLimit) { |
| 451 | i = channel->modulateVolumeBase * 2; |
| 452 | } |
| 453 | channel->modulateVolumeIndex = i; |
| 454 | } |
| 455 | } |
| 456 | |
| 457 | template<typename T> inline T CLIP(T v, T amin, T amax) { |
| 458 | if (v < amin) return amin; else if (v > amax) return amax; else return v; |
nothing calls this directly
no outgoing calls
no test coverage detected