FunkIt TST.L Counter
BNE Return2
MOVE.B n_cmdlo(A6),D0
AND.B #$0F,D0
LSL.B #4,D0
AND.B #$0F,n_glissfunk(A6)
OR.B D0,n_glissfunk(A6)
TST.B D0
BEQ Return2
UpdateFunk
MOVEM.L A0/D1,-(SP)
MOVEQ #0,D0
MOVE.B n_glissfunk(A6),D0
LSR.B #4,D0
BEQ funkend
LEA FunkTable(PC),A0
MOVE.B (A0,D0.W),D0
ADD.B D0,n_funkoffset(A6)
BTST #7,n_funkoffset(A6)
BEQ funkend
CLR.B n_funkoffset(A6)
MOVE.L n_loopstart(A6),D0
MOVEQ #0,D1
MOVE.W n_replen(A6),D1
ADD.L D1,D0
ADD.L D1,D0
MOVE.L n_wavestart(A6),A0
ADDQ.L #1,A0
CMP.L D0,A0
BLO.S funkok
MOVE.L n_loopstart(A6),A0
funkok MOVE.L A0,n_wavestart(A6)
MOVEQ #-1,D0
SUB.B (A0),D0
MOVE.B D0,(A0)
funkend MOVEM.L (SP)+,A0/D1
RTS
FunkIt TST.L Counter
BNE Return2
if (mod_tick != 0) goto return2;
return2 is a label with a "RTS return to subroutine" instruction in the protracker source code.
FunkIt is called *whenever* EFx is found. UpdateFunk is called in every tick in do_note:
chkefx2 BSR UpdateFunk <-- Run the updatefunk routine, skipping the "FunkIt" part
[..] check for other effects here. UpdateFunk is run *no matter* if funkspeed == 0,
UpdateFunk checks if speed == 0, else goto return2