⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 volume.s

📁 samsung 9908DVD源代码,
💻 S
字号:
;-----------------------------------------------------------
;		The following program will decoding MP3 bitstream
;		by S/W Algorithm
;			File Name: antalias.s
;			copyright jj,Park      1999.2.7
;	profile
;		1. 6/7//1999
;			- update all	
;-----------------------------------------------------------
.include	"mp3_def.h"
.include	"mp3_ext.h"

		MP3VolumeSection
;-----------------------------------------------------------
;		The following program will decoding MP3 bitstream
;		by S/W Algorithm
;			File Name: volume.s
;	The pcm data are located 
;	from rpd1.index_GptrPcmSamples
;	to rpd1.index_GptrPcmSamples+1152W
;-----------------------------------------------------------
.if(1)
VolumeControl::
	eld		a		,rpd1.index_GptrPcmSamples		;update index_GptrPcmSamples
	//eld		a		,#Area_pcmSamples
	eld		rp0		,a

//	ldb		r0		,@[a10+Index_VolumeIndex]
	ldb		r0		,@[a13+Index_VolumeControl]		
	
	eld		a		,GLayerDiff
	ecld	r5		,a
	cmp		eq		,r5		,#0
	brf		Layer1_2_Vol

//	ld		a12		,#IndexTD_Vol
	eld		a		,IndexTD_Vol
	ecld	r4		,a
//	ldw		r4		,@[a12+0]
//	cmp		gt		,r0		,#17//9
	cmp		ge		,r0		,r4	
	brt		HighVolPass
Layer1_2_Vol	
	ecld	a		,r0
	efz16	a
	eadd	a		,#tbl_volume						; get the value from 
	eld		rp1		,a	
	eld		x0		,@rp1

	eld		sd0		,#((-1&0fh)<<12)|(2<<8)|((-1&0fh)<<4)|(1<<0)
	
//	eld		a		,GLayerDiff
//	ecld	r6		,a
	cmp		eq		,r5		,#2
	brf		Layer2_3T
Layer1T	
	ld		r6		,#768-1
	bra		%f30
Layer2_3T	
	ld		r6		,#1152-1
%30	

	cmp		eq		,r5		,#0
	brt		L3FreqAndTimeVol
	
	eld		y0		,@rp0+s0
VolumeControlLoopL12:	
	emul	x0y0	,y0		,@rp0+s1
	bnzd	r6		,VolumeControlLoopL12
	eld		@rp0+d0	,p	
	
	bra		HighVolPass
L3FreqAndTimeVol
	
	eld		a		,G_SubVolume
	eld		x1		,a
	
	//eld		y0		,@rp0+s0
	esd2	d0		,#1
	eld		rp2		,rp0
	eld		a		,@rp0+s0
	esla	a
	esla	a
	eld		y0		,a
VolumeControlLoop:	
	emul	x1y0
	emld	ma0		,x1y0
	esla	ma0
	eld		y0		,ma0
	
	emul	x0y0	
	emld	ma0		,x0y0
//	esla	ma0
	eld		@rp2+d0	,ma0	
	
	eld		a		,@rp0+s0
	esla	a
	esla	a
	bnzd	r6		,VolumeControlLoop
	eld		y0		,a
	
HighVolPass
	ret
.endif

VolumeConFreq::
	eld		a		,rpd1.index_GptrCurrentDecodingData	//1010
	eld		rp0		,a									//1010

//	ldb		r0		,@[a10+Index_VolumeIndex]
	ldb		r0		,@[a13+Index_VolumeControl]
	
//	ld		a12		,#IndexFD_Vol
//	ldw		r5		,@[a12+0]
	eld		a		,IndexFD_Vol
	ecld	r5		,a
//	cmp		ge		,r0		,#18//10
	cmp		ge		,r0		,r5		
	brt		HighVolPassFreq
	
//	ld		r0		,#18
	ld		r0		,r5
HighVolPassFreq		
	ecld	a		,r0
	efz16	a
	eadd	a		,#tbl_volume						; get the value from 
	eld		rp1		,a	
	eld		x0		,@rp1

	eld		sd0		,#((-1&0fh)<<12)|(1<<8)|((-1&0fh)<<4)|(1<<0)
	eld		sd2		,#((-1&0fh)<<12)|(1<<8)|((-1&0fh)<<4)|(1<<0)
	eld		rp2		,rp0
	
	eld		a		,GLayerDiff
	ecld	r6		,a
	cmp		eq		,r6		,#2
	brf		Layer2_3F
Layer1F	
	ld		r6		,#48-1
	bra		%f10
Layer2_3F	
	ld		r6		,#72-1
%10			
	
	eld		y0		,@rp0+s0
VolumeControlLoopF:	
	emul	x0y0	,y0		,@rp0+s0
	eld		@rp2+d0	,p
	emul	x0y0	,y0		,@rp0+s0
	eld		@rp2+d0	,p
	emul	x0y0	,y0		,@rp0+s0
	eld		@rp2+d0	,p
	emul	x0y0	,y0		,@rp0+s0
	eld		@rp2+d0	,p
	emul	x0y0	,y0		,@rp0+s0
	eld		@rp2+d0	,p
	emul	x0y0	,y0		,@rp0+s0
	eld		@rp2+d0	,p
	emul	x0y0	,y0		,@rp0+s0
	eld		@rp2+d0	,p
	emul	x0y0	,y0		,@rp0+s0
	bnzd	r6		,VolumeControlLoopF
	eld		@rp2+d0	,p		

	ret	
	
VolumeFadeIn::	
//	ldb		r0		,@[a10+Index_VolumeIndex]
	ldb		r0		,@[a13+Index_VolumeControl]
	eld		a		,G_PrevVol
	ecld	r1		,a
	
	cmp		eq		,r0		,r1
	brt		NotChangedVol
		
	ecld	a		,r0
	efz16	a
	eld		G_PrevVol,a
	eadd	a		,#tbl_volume						; get the value from 
	eld		rp1		,a	
	eld		a		,@rp1
	eld		d		,a
	
	ecld	c		,r1
	efz16	c
	eadd	c		,#tbl_volume						; get the value from 
	eld		rp1		,c	
	eld		c		,@rp1	
	
	esub	a		,c
	eneg	a
	
	eld		y1		,a
	eld		x1		,#0x38E3						//1/576
	emul	x1y1	
	eld		b		,prn
	eld		ma0		,b
	
	eld		b		,rpd1.index_GptrPcmSamples		;update index_GptrPcmSamples
	eld		rp0		,b	
	erpn	rp0		,#1151

	eld		sd0		,#((-1&0fh)<<12)|(1<<8)|((0&0fh)<<4)|(1<<0)

	eld		b		,GLayerDiff
	ecld	r6		,b
	cmp		eq		,r6		,#2
	brf		Layer2_3FV
Layer1FV	
	ld		r6		,#384-1
	bra		%f90
Layer2_3FV	
	ld		r6		,#576-1
%90
	
	eld		rp1		,#tbl_volume+31
	eld		a		,@rp1			
	esra	a
FadeInLoop:	
	eld		x0		,@rp0+s1
	eld		y0		,a					;
	emul	x0y0	
	eld		b		,prn
	esla	b
	eld		@rp0+d1	,b						;a<-y1+x*(y2-y1)/(x2-x1)							;a<-y1+x*(y2-y1)/(x2-x1)	
	
	enop

	eld		x0		,@rp0+s1
	emul	x0y0	
	eld		b		,prn
	eadd	a		,ma0
	esla	b
	bnzd	r6		,FadeInLoop
	eld		@rp0+d1	,b	

NotChangedVol

	ret

	
	end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -