Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void UpdateInvertLoop(mod_channel *ch)
- {
- static const unsigned char pt_tab_invloop[16] =
- {
- 0x00, 0x05, 0x06, 0x07, 0x08, 0x0A, 0x0B, 0x0D,
- 0x0F, 0x13, 0x16, 0x1A, 0x20, 0x2B, 0x40, 0x80
- };
- ch->invloop_delay += pt_tab_invloop[ch->invloop_speed];
- if (ch->invloop_delay >= 128)
- {
- ch->invloop_delay = 0;
- if (ch->sample > 0)
- {
- MODULE_SAMPLE *s = &source->samples[ch->sample - 1];
- if (s->loop_length >= 4)
- {
- ch->invloop_offset++;
- if (ch->invloop_offset >= s->loop_end)
- {
- ch->invloop_offset = s->loop_start;
- }
- source->sample_data[s->offset + ch->invloop_offset] ^= 0xFF;
- }
- }
- }
- return;
- }
- static void effecte_invertloop(mod_channel *ch)
- {
- if (mod_tick == 0)
- {
- ch->invloop_speed = ch->param & 0x0F;
- UpdateInvertLoop(ch);
- }
- return;
- }
- static void update_effect(mod_channel *ch)
- {
- if (mod_tick > 0)
- {
- UpdateInvertLoop(ch);
- }
- effect_routines[ch->command](ch);
- return;
- }
- static void update_channel(mod_channel *ch)
- {
- aflags = 0;
- if (mod_tick == 0)
- {
- if (pattern_delay_2 == 0)
- {
- read_note(ch);
- }
- /* if a sample number is found */
- if (ch->sample > 0)
- {
- MODULE_SAMPLE *s = &source->samples[ch->sample - 1];
- ch->invloop_offset = s->loop_start;
- }
- /* ... */
- }
- /* ... */
- update_effect(ch);
- /* ... */
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement