📄 trebble_bass_new.s
字号:
nop
mulhf r2, r4, %max
maddhf r2, r4, %max
maddhf r2, r4, %max
nop
rndhf i1, r2
#endif
block_filter:
;**************************************
;***** enable interrupt mask **********
movi TrapReg, 0x24
;**************************************
;**************************************
;************ save the history of the lattice *******************************
movh r0,%Cu0u1 ; current DRAM @ of history
#ifdef EFFECT
shr r0, 2 ; to word addr
movi DMASize, 0 //1 words (2 shorts)
movi LocalAddr, (u1_1)>>2
dmawr r0
WaitDma
addi r0,1
movi DMASize, 0 //1 words (2 shorts)
movi LocalAddr, (u0_1)>>2
dmawr r0
WaitDma
#else //EFFECT
movi ByteSize, 0x2
movi ByteLocal, u1_1
dmabwr r0
movi ByteSize, 0x2
movi ByteLocal, u0_1
addi r0, 0x4
dmabwr r0
#endif //EFFECT
;************ check if right channel has been processed *********************
;************ set up the right channel and jump back if necessary ***********
movh r12, %left_right
tsti r12, 0x1
bne channel2_done
movi r0, 0x0
movh %left_right, r0 ; set flag to right channel
movh %Cu0u1, r15 ; current DRAM @ of history
mov r14, r15 ; for computation of right channel....
movi r2, localA_data+2 ; set input @
j channel1_done
channel2_done:
nop
;************ restaure the value of r8 before returning to main routine ****
movh r8, %r8_tmp
;************ enable rounding in Status Register ***************************
mov r2, StatusReg
andi r2, 0xfeff
mov StatusReg, r2
j r11 ; return to main routine
.sdata
.global bass_coeff
.global trebble_coeff
bass_coeff: .align
;;;;;;;;; central frequency = 100 Hz ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; bass -17 dB
.short 0x8732 ;k2 0
.short 0x2a51 ;s2
.short 0x7ffd ;k1
.short 0x1d3 ;s1
.short 0x841b ;c2
.short 0x1825 ;c1
.short 0xffa8 ;c0
.short 0x0000 ; dummy
; bass -15 dB
.short 0x8692 ;k2 1
.short 0x287c ;s2
.short 0x7ffd ;k1
.short 0x01d3 ;s1
.short 0x83df ;c2
.short 0x17d6 ;c1
.short 0xffa9 ;c0
.short 0x0000 ; dummy
; bass -12.5 dB
.short 0x85ec ;k2 2
.short 0x267d ;s2
.short 0x7ffd ;k1
.short 0x01d3 ;s1
.short 0x83aa ;c2
.short 0x17ce ;c1
.short 0xffa9 ;c0
.short 0x0000 ; dummy
; bass -10 dB
.short 0x856e ;k2 3
.short 0x24e1 ;s2
.short 0x7ffd ;k1
.short 0x01d3 ;s1
.short 0x8393 ;c2
.short 0x1845 ;c1
.short 0xffa7 ;c0
.short 0x0000 ; dummy
; bass -7.5 dB
.short 0x851e ;k2 4
.short 0x23d5 ;s2
.short 0x7ffd ;k1
.short 0x01d3 ;s1
.short 0x83a3 ;c2
.short 0x1978 ;c1
.short 0xffa3 ;c0
.short 0x0000 ; dummy
; bass -5 dB
.short 0x8518 ;k2 5
.short 0x23c1 ;s2
.short 0x7ffd ;k1
.short 0x01d3 ;s1
.short 0x83fb ;c2
.short 0x1bed ;c1
.short 0xff9a ;c0
.short 0x0000 ; dummy
; bass -2.5 dB
.short 0x85d2 ;k2 6
.short 0x2628 ;s2
.short 0x7ffd ;k1
.short 0x01d3 ;s1
.short 0x8517 ;c2
.short 0x2162 ;c1
.short 0xff86 ;c0
.short 0x0000 ; dummy
; bass 0 dB (default value)
.short 0x0000 ; k2 7
.short 0x7fff ; s2
.short 0x0000 ; k1
.short 0x7fff ; s1
.short 0x0000 ; c2
.short 0x0000 ; c1
.short 0x8000 ; c0
.short 0x0000 ; dummy
;bass 2.5 dB
.short 0x8464 ;k2 8
.short 0x213b ;s2
.short 0x7ffd ;k1
.short 0x01d3 ;s1
.short 0x851f ;c2
.short 0x26c5 ;c1
.short 0xff73 ;c0
.short 0x0000 ; dummy
;bass 5 dB
.short 0x82e4 ;k2 9
.short 0x1b0c ;s2
.short 0x7ffd ;k1
.short 0x01d3 ;s1
.short 0x8404 ;c2
.short 0x2591 ;c1
.short 0xff77 ;c0
.short 0x0000 ; dummy
;bass 7.5 dB
.short 0x822f ;k2 a
.short 0x178b ;s2
.short 0x7ffd ;k1
.short 0x01d3 ;s1
.short 0x84ed ;c2
.short 0x2748 ;c1
.short 0xff71 ;c0
.short 0x0000 ; dummy
; bass 10 dB
.short 0x81be ;k2 b
.short 0x150b ;s2
.short 0x7ffd ;k1
.short 0x01d3 ;s1
.short 0x83a0 ;c2
.short 0x2bcb ;c1
.short 0xff60 ;c0
.short 0x0000 ; dummy
; bass 12.5 dB
.short 0x816e ;k2 c
.short 0x1314 ;s2
.short 0x7ffd ;k1
.short 0x01d3 ;s1
;; .short 0x83bb ;c2
;; .short 0x31c3 ;c1
;; .short 0xff4a ;c0
.short 0x89f2 ; c2 * 0.95
.short 0x2f46 ; c1 * 0.95
.short 0xff53 ; c0 * 0.95
.short 0x0000 ; dummy
; bass 15 dB
.short 0x8131 ;k2 d
.short 0x116f ;s2
.short 0x7ffd ;k1
.short 0x01d3 ;s1
;; .short 0x83f4 ;c2
;; .short 0x39c4 ;c1
;; .short 0xff2d ;c0
.short 0x905c ; c2 * 0.90
.short 0x36e1 ; c1 * 0.90
.short 0xff42 ; c0 * 0.90
.short 0x0000 ; dummy
; bass 17 dB
.short 0x810b ;k2 e
.short 0x104c ;s2
.short 0x7ffd ;k1
.short 0x01d3 ;s1
;; .short 0x8435 ;c2
;; .short 0xc1d4 ;c1
;; .short 0xff0e ;c0
#if 0
.short 0x9940 ; c2 * 0.83
.short 0xcc66 ; c1 * 0.83
.short 0xff37 ; c0 * 0.83
.short 0x96c7 ; c2 * 0.85
.short 0xcb27 ; c1 * 0.85
.short 0xff33 ; c0 * 0.85
.short 0x944d ; c2 * 0.87
.short 0xc9e9 ; c1 * 0.87
.short 0xff2e ; c0 * 0.87
#else
.short 0x9096 ; c2 * 0.90
.short 0x37f4 ; c1 * 0.90
.short 0xff27 ; c0 * 0.90
#endif
.short 0x0000 ; dummy
trebble_coeff: .align
;;;;;;;;; central frequency = 9 Khz ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; trebble 11 kHz -17 dB:
.short 0x29d8 ; k2 0
.short 0x78f8 ; s2
.short 0x1e9b ; k1
.short 0x7c49 ; s1
.short 0xe0eb ; c2
.short 0x1081 ; c1
.short 0xbcfa ; c0
.short 0x0000 ; dummy
; trebble 11 kHz -15 dB:
.short 0x246e ; k2 1
.short 0x7ab5 ; s2
.short 0x1e9b ; k1
.short 0x7c49 ; s1
.short 0xe0d6 ; c2
.short 0x1147 ; c1
.short 0xb9d5 ; c0
.short 0x0000 ; dummy
; trebble 11 kHz -12.5 dB:
.short 0x1e13 ; k2 2
.short 0x7c6b ; s2
.short 0x1e9b ; k1
.short 0x7c49 ; s1
.short 0xe1c8 ; c2
.short 0x1267 ; c1
.short 0xb546 ; c0
.short 0x0000 ; dummy
; trebble 11 kHz -10 dB:
.short 0x18a1 ; k2 3
.short 0x7d9c ; s2
.short 0x1e9b ; k1
.short 0x7c49 ; s1
.short 0xe473 ; c2
.short 0x13c4 ; c1
.short 0xafbc ; c0
.short 0x0000 ; dummy
; trebble 11 kHz -7.5 dB:
.short 0x14e7 ; k2 4
.short 0x7e48 ; s2
.short 0x1e9b ; k1
.short 0x7c49 ; s1
.short 0xe9d9 ; c2
.short 0x1577 ; c1
.short 0xa8d6 ; c0
.short 0x0000 ; dummy
; trebble 11 kHz - 5 dB:
.short 0x149e ; k2 5
.short 0x7e54 ; s2
.short 0x1e9b ; k1
.short 0x7c49 ; s1
.short 0xf418 ; c2
.short 0x1799 ; c1
.short 0xa02e ; c0
.short 0x0000 ; dummy
; trebble 11 kHz -2.5 dB:
.short 0x1cfb ; k2 6
.short 0x7cad ; s2
.short 0x1e9b ; k1
.short 0x7c49 ; s1
.short 0x95a ; c2
.short 0x1a15 ; c1
.short 0x9614 ; c0
.short 0x0000 ; dummy
; trebble 0 dB: (default configuration)
.short 0x0000 ; k2 7
.short 0x7fff ; s2
.short 0x0000 ; k1
.short 0x7fff ; s1
.short 0x0000 ; c2
.short 0x0000 ; c1
.short 0x8000 ; c0
.short 0x0000 ; dummy
; trebble 9 kHz 2.5 dB:
.short 0x6d3 ; k2 8
.short 0x7fd1 ; s2
.short 0x356c ; k1
.short 0x7451 ; s1
.short 0x1d4f ; c2
.short 0xbe3e ; c1-1.0
.short 0x787a ; c0+2.0
.short 0x0000 ; dummy
; trebble 9 kHz 5 dB:
.short 0xebe2 ; k2 9
.short 0x7e69 ; s2
.short 0x356c ; k1
.short 0x7451 ; s1
.short 0x15de ; c2
.short 0xc94a ; c1-1.0
.short 0x606d ; c0+2.0
.short 0x0000 ; dummy
; trebble 9 kHz 7.5 dB:
.short 0xddb4 ; k2 a
.short 0x7b52 ; s2
.short 0x356c ; k1
.short 0x7451 ; s1
.short 0x17bd ; c2
.short 0xd359 ; c1-1.0
.short 0x4a87 ; c0+2.0
.short 0x0000 ; dummy
; trebble 9 kHz 10 dB:
.short 0xcdd9 ; k2 b
.short 0x75c4 ; s2
.short 0x356c ; k1
.short 0x7451 ; s1
.short 0x2204 ; c2
.short 0xe64b ; c1-1.0
.short 0x2148 ; c0+2.0
.short 0x0000 ; dummy
; trebble 9 kHz 12 dB:
.short 0xc386 ; k2 c
.short 0x70d0 ; s2
.short 0x356c ; k1
.short 0x7451 ; s1
;; .short 0x3022 ; c2
;; .short 0xfad2 ; c1-1.0
;; .short 0xf496 ; c0+2.0
.short 0x2dba ; c2 * 0.95
.short 0xf4ae ; c1 * 0.95 - 1.0
.short 0x01f5 ; c0 * 0.95 + 2.0
.short 0x0000 ; dummy
; trebble 9 kHz 15 dB:
.short 0xbae7 ; k2 d
.short 0x6bbf ; s2
.short 0x356c ; k1
.short 0x7451 ; s1
;; .short 0x4310 ; c2
;; .short 0x14ee ; c1-1.0
;; .short 0xbbbd ; c0+2.0
.short 0x3f5b ; c2 * 0.90
.short 0x0609 ; c1 * 0.90 - 1.0
.short 0xdc2a ; c0 * 0.90 + 2.0
.short 0x0000 ; dummy
; trebble 9 kHz 17 dB:
.short 0xb4ec ; k2 e
.short 0x67ac ; s2
.short 0x356c ; k1
.short 0x7451 ; s1
;; .short 0x55cc ; c2
;; .short 0x2ecc ; c1-1.0
;; .short 0x836c ; c0+2.0
#if 0
.short 0x4736 ; c2 * 0.83
.short 0x1115 ; c1 * 0.83 - 1.0
.short 0xc41f ; c0 * 0.83 + 2.0
.short 0x4aa6 ; c2 * 0.87
.short 0x1814 ; c1 * 0.87 - 1.0
.short 0xb4e4 ; c0 * 0.87 + 2.0
#else
.short 0x48ed ; c2 * 0.85
.short 0x1495 ; c1 * 0.85 - 1.0
.short 0xbc82 ; c0 * 0.85 + 2.0
#endif
.short 0x0000 ; dummy
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -