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

Method executeSongSequenceOp

Source/Amiga/rjp1.cpp:212–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212bool Rjp1::executeSongSequenceOp(Rjp1Channel *channel, uint8 code, const uint8 *&p) {
213 bool loop = true;
214 const uint8 *offs;
215 switch (code & 7) {
216 case 0:
217 offs = channel->sequenceOffsets;
218 channel->loopSeq2Count = 1;
219 while (1) {
220 code = *offs++;
221 if (code != 0) {
222 channel->sequenceOffsets = offs;
223 p = readBEDWord(_vars.songData[4] + code * 4) + _vars.songData[6];
224 break;
225 } else {
226 code = offs[0];
227 if (code == 0) {
228 p = 0;
229 channel->active = false;
230 _vars.activeChannelsMask &= ~(1 << _vars.currentChannel);
231 loop = false;
232 break;
233 } else if (code & 0x80) {
234 code = offs[1];
235 offs = readBEDWord(_vars.songData[3] + code * 4) + _vars.songData[5];
236 } else {
237 offs -= code;
238 }
239 }
240 }
241 break;
242 case 1:
243 setRelease(channel);
244 loop = false;
245 break;
246 case 2: // loc_A423A
247 channel->loopSeqCount = *p++;
248 break;
249 case 3: // loc_A4240
250 channel->loopSeq2Count = *p++;
251 break;
252 case 4: // loc_A4246
253 code = *p++;
254 if (code != 0) {
255 if (code >= _vars.instrumentsCount)
256 code = 0;
257
258 setupInstrument(channel, code);
259 }
260 break;
261 case 5:
262 channel->volumeScale = *p++;
263 break;
264 case 6:
265 channel->freqStep = *p++;
266 channel->freqInc = readBEDWord(p); p += 4;
267 channel->freqInit = 0;
268 break;
269 case 7:

Callers

nothing calls this directly

Calls 1

readBEDWordFunction · 0.85

Tested by

no test coverage detected