
	.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 * $100
	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	@dcd	t_arpeggio			;0	Normal Play or Arpeggio
		@dcd	t_effekt_portaup		;1	Slide Up
		@dcd	t_effekt_portadown		;2	Slide Down
		@dcd	effekt_end_t			;3	Tone Portamento
		@dcd	effekt_end_t			;4	Vibrato
		@dcd	effekt_end_t			;5	Tone Portamento + Volume Slide
		@dcd	effekt_end_t			;6	Vibrato + Volume Slide
		@dcd	effekt_end_t			;7	Tremolo
		@dcd	effekt_end_t			;8	not used !
		@dcd	effekt_end_t			;9	
		@dcd	effekt_end_t			;a	
		@dcd	effekt_end_t			;b	
		@dcd	effekt_end_t			;c	
		@dcd	effekt_end_t			;d	
		@dcd	effekt_end_t			;e	E-Effekts
		@dcd	effekt_end_t			;f	

;**** Standard Effekte

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

;**** Standard E-Effekte

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