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

Method setupInstrument

Source/Amiga/rjp1.cpp:355–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353}
354
355void Rjp1::setupInstrument(Rjp1Channel *channel, uint8 num) {
356 if (channel->currentInstrument != num) {
357 channel->currentInstrument = num;
358 const uint8 *p = _vars.songData[0] + num * 32;
359 channel->noteData = p;
360 channel->repeatPos = readBEWord(p + 20);
361 channel->repeatLen = readBEWord(p + 22);
362 channel->volumeScale = readBEWord(p + 14);
363 channel->modulatePeriodBase = readBEWord(p + 24);
364 channel->modulatePeriodIndex = 0;
365 channel->modulatePeriodLimit = readBEWord(p + 26) * 2;
366 channel->modulateVolumeBase = readBEWord(p + 28);
367 channel->modulateVolumeIndex = 0;
368 channel->modulateVolumeLimit = readBEWord(p + 30) * 2;
369 channel->waveData = _vars.instData + readBEDWord(p);
370 uint32 off = readBEDWord(p + 4);
371 channel->modulatePeriodData = _vars.instData + off;
372 off = readBEDWord(p + 8);
373 channel->modulateVolumeData = _vars.instData + off;
374 }
375}
376
377void Rjp1::setRelease(Rjp1Channel *channel) {
378 const int8 *e = channel->envelopeData;

Callers

nothing calls this directly

Calls 2

readBEWordFunction · 0.85
readBEDWordFunction · 0.85

Tested by

no test coverage detected