
	.include	"sound_mod.i"
	.include	"sound_mix.i"
	
	.align	4
	.thumb

@**: change Sampleoffset

	.global		effekt_sample_offset_th	
	.global		effekt_speed_th	
	

effekt_sample_offset_th:

	mov	r0,r9
	lsl	r7,r7,#9			@sampleoffset = effektparam * 0x100
	str	r7,[r0,#CHANEL_SAMPLE_START]
	bx	lr
	
@**: Speed	
	
	
	
effekt_speed_th:

	cmp	r7,#20				@<20 Speed >20-ff tempo
	bge	est_is_tempo
	
	mov	r0,r12
	sub	r7,r7,#1
	str	r7,[r0,#MOD_TICK_GO]		@Speed
	

est_is_tempo:
	
	bx	lr
	
	
@**********************************: JUMPLISTS ****************************************

		.global		effect_tbl_t
		.global		effect_tbl
		.global		effect_tbl_e
		


@****: Tick Effekte

effect_tbl_t:	.long	t_arpeggio			@0	Normal Play or Arpeggio
		.long	t_effekt_portaup		@1	Slide Up
		.long	t_effekt_portadown		@2	Slide Down
		.long	effekt_end_t			@3	Tone Portamento
		.long	effekt_end_t			@4	Vibrato
		.long	effekt_end_t			@5	Tone Portamento + Volume Slide
		.long	effekt_end_t			@6	Vibrato + Volume Slide
		.long	effekt_end_t			@7	Tremolo
		.long	effekt_end_t			@8	not used !
		.long	effekt_end_t			@9	
		.long	effekt_end_t			@a	
		.long	effekt_end_t			@b	
		.long	effekt_end_t			@c	
		.long	effekt_end_t			@d	
		.long	effekt_end_t			@e	E-Effekts
		.long	effekt_end_t			@f	

@****: Standard Effekte

effect_tbl:	.long	effekt_end			@0	
		.long	effekt_end			@1	
		.long	effekt_end			@2	
		.long	effekt_end			@3	
		.long	effekt_end			@4	
		.long	effekt_end			@5	
		.long	effekt_end			@6	
		.long	effekt_end			@7	
		.long	effekt_end			@8	not used !
		.long	(effekt_sample_offset_th)+1	@9	Set Sample Offset
		.long	effekt_volumeslide		@a	Volume Slide
		.long	effekt_position_jump		@b	Position Jump
		.long	effekt_setvolume		@c	Set Volume
		.long	effekt_patternbreak		@d	Pattern Break
		.long	decode_e_effects		@e	E-Effekts
		.long	(effekt_speed_th)+1			@f	Set Speed

@****: Standard E-Effekte

effect_tbl_e:	.long	effekt_end			@0	Set Filter
		.long	e_effekt_fineportaup		@1	FineSlide Up
		.long	e_effekt_fineportadown		@2	FineSlide Down
		.long	effekt_end			@3	Glissando Control
		.long	effekt_end			@4	Set Vibrato Waveform
		.long	e_effekt_setfinetune		@5	Set Finetune
		.long	effekt_end			@6	Pattern Loop
		.long	effekt_end			@7	Tremelo Waveform
		.long	effekt_end			@8	not used
		.long	effekt_end			@9	Retrige Note
		.long	e_effekt_finevolumeslideup	@a	Fine Volume Slide Up -
		.long	e_effekt_finevolumeslidedown	@b	Fine Volume Slide Down -
		.long	effekt_end			@c	Cute Note
		.long	effekt_end			@d	Delay Note
		.long	effekt_end			@e	Pattern Delay -
		.long	effekt_end			@f	Inver Loop (NOT SUPPORTED)
		
		
	.end		