MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / modulatePeriod

Method modulatePeriod

Source/Amiga/rjp1.cpp:314–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312}
313
314void Rjp1::modulatePeriod(Rjp1Channel *channel) {
315 if (channel->modulatePeriodData) {
316 uint32 per = channel->modulatePeriodIndex;
317 int period = (channel->modulatePeriodData[per] * channel->modulatePeriodInit) / 128;
318 period = -period;
319 if (period < 0) {
320 period /= 2;
321 }
322 channel->modulatePeriodNext = period + channel->modulatePeriodInit;
323 ++per;
324 if (per == channel->modulatePeriodLimit) {
325 per = channel->modulatePeriodBase * 2;
326 }
327 channel->modulatePeriodIndex = per;
328 }
329 if (channel->freqStep != 0) {
330 channel->freqInit += channel->freqInc;
331 --channel->freqStep;
332 }
333 setChannelPeriod(channel - _channelsTable, channel->freqInit + channel->modulatePeriodNext);
334}
335
336void Rjp1::setupNote(Rjp1Channel *channel, int16 period) {
337 const uint8 *note = channel->noteData;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected