| 235 | } |
| 236 | |
| 237 | static void __forceinline UpdatePitch(uint coreidx, uint voiceidx) |
| 238 | { |
| 239 | V_Voice& vc(Cores[coreidx].Voices[voiceidx]); |
| 240 | s32 pitch; |
| 241 | |
| 242 | // [Air] : re-ordered comparisons: Modulated is much more likely to be zero than voice, |
| 243 | // and so the way it was before it's have to check both voice and modulated values |
| 244 | // most of the time. Now it'll just check Modulated and short-circuit past the voice |
| 245 | // check (not that it amounts to much, but eh every little bit helps). |
| 246 | if ((vc.Modulated == 0) || (voiceidx == 0)) |
| 247 | pitch = vc.Pitch; |
| 248 | else |
| 249 | pitch = std::clamp((vc.Pitch * (32768 + Cores[coreidx].Voices[voiceidx - 1].OutX)) >> 15, 0, 0x3fff); |
| 250 | |
| 251 | pitch = std::min(pitch, 0x3FFF); |
| 252 | vc.SP += pitch; |
| 253 | } |
| 254 | |
| 255 | static __forceinline void CalculateADSR(V_Core& thiscore, uint voiceidx) |
| 256 | { |