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

📄 play.s

📁 mega128+VS1003做的mp3的程序 可以用WINAVR编译
💻 S
📖 第 1 页 / 共 5 页
字号:
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
	.dbline 739
; 
	dec R16
	.dbline -2
L29:
	.dbline 0 ; func end
	ret
	.dbsym r mLength 16 c
	.dbend
	.dbfunc e xReadFromExtBuf _xReadFromExtBuf fV
;        mLength -> R16
	.even
_xReadFromExtBuf::
	.dbline -1
	.dbline 743
; 
; 
; 
; 
	.dbline 744
; 
	dec R16
	.dbline -2
L30:
	.dbline 0 ; func end
	ret
	.dbsym r mLength 16 c
	.dbend
	.dbfunc e CH375LibInit _CH375LibInit fc
	.even
_CH375LibInit::
	.dbline -1
	.dbline 750
; 
; 
; 
; 
; 
; 
	.dbline 751
; 
	ldi R24,5
	sts _CH375LibConfig,R24
	.dbline 752
; 
	clr R2
	sts _DISK_BASE_BUF,R2
	.dbline 753
; 
	xcall _CH375GetVer
	cpi R16,41
	brsh L32
	.dbline 753
	ldi R16,255
	xjmp L31
L32:
	.dbline 754
; 
	xcall _CH375Init
	.dbline -2
L31:
	.dbline 0 ; func end
	ret
	.dbend
	.dbfile Play.c
	.dbfunc e mp3_pause _mp3_pause fV
	.even
_mp3_pause::
	.dbline -1
	.dbline 43
L35:
	.dbline 44
L36:
	.dbline 44
	xjmp L35
X0:
	.dbline -2
L34:
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e mDelaymS _mDelaymS fV
;              i -> R10,R11
;             ms -> y+10
	.even
_mDelaymS::
	xcall push_arg4
	xcall push_gset3
	sbiw R28,4
	.dbline -1
	.dbline 47
	xjmp L40
L39:
	.dbline 49
	ldi R24,2600
	ldi R25,10
	movw R10,R24
	xjmp L45
L42:
	.dbline 49
L43:
	.dbline 49
	movw R24,R10
	sbiw R24,1
	movw R10,R24
L45:
	.dbline 49
	tst R10
	brne L42
	tst R11
	brne L42
X1:
L40:
	.dbline 49
	movw R30,R28
	ldd R2,z+10
	ldd R3,z+11
	ldd R4,z+12
	ldd R5,z+13
	movw R30,R28
	std z+0,R2
	std z+1,R3
	std z+2,R4
	std z+3,R5
	ldi R20,1
	ldi R21,0
	ldi R22,0
	ldi R23,0
	movw R30,R28
	ldd R2,z+0
	ldd R3,z+1
	ldd R4,z+2
	ldd R5,z+3
	sub R2,R20
	sbc R3,R21
	sbc R4,R22
	sbc R5,R23
	movw R30,R28
	std z+10,R2
	std z+11,R3
	std z+12,R4
	std z+13,R5
	ldi R20,0
	ldi R21,0
	ldi R22,0
	ldi R23,0
	movw R30,R28
	ldd R2,z+0
	ldd R3,z+1
	ldd R4,z+2
	ldd R5,z+3
	cp R2,R20
	cpc R3,R21
	cpc R4,R22
	cpc R5,R23
	breq X2
	xjmp L39
X2:
	.dbline -2
L38:
	adiw R28,4
	xcall pop_gset3
	adiw R28,4
	.dbline 0 ; func end
	ret
	.dbsym r i 10 s
	.dbsym l ms 10 l
	.dbend
	.dbfunc e test_vs1003 _test_vs1003 fV
;   data_pointer -> R20,R21
;              i -> R22
	.even
_test_vs1003::
	xcall push_gset2
	.dbline -1
	.dbline 55
	.dbline 57
	ldi R16,<L47
	ldi R17,>L47
	xcall _Print_str
	xjmp L49
L48:
	.dbline 59
	.dbline 60
	clr R20
	clr R21
	xjmp L52
L51:
	.dbline 62
	.dbline 63
	sbis 0x10,0
	rjmp L54
	.dbline 64
	.dbline 65
	.dbline 65
	cbi 0x12,2
	.dbline 65
	.dbline 65
	.dbline 66
	clr R22
	xjmp L59
L56:
	.dbline 67
	.dbline 68
	movw R2,R20
	subi R20,255  ; offset = 1
	sbci R21,255
	ldi R24,<_vsBeepMP3
	ldi R25,>_vsBeepMP3
	movw R30,R2
	add R30,R24
	adc R31,R25
	lpm R16,Z
	xcall _spiSend
	.dbline 69
L57:
	.dbline 66
	inc R22
L59:
	.dbline 66
	cpi R22,32
	brlo L56
	.dbline 70
	.dbline 70
	sbi 0x12,2
	.dbline 70
	.dbline 70
	.dbline 71
L54:
	.dbline 72
L52:
	.dbline 61
	cpi R20,192
	ldi R30,18
	cpc R21,R30
	brlo L51
	.dbline 73
L49:
	.dbline 58
	xjmp L48
X3:
	.dbline -2
L46:
	xcall pop_gset2
	.dbline 0 ; func end
	ret
	.dbsym r data_pointer 20 s
	.dbsym r i 22 c
	.dbend
	.dbfunc e Init_usb _Init_usb fV
;        usbsize -> <dead>
;             t2 -> <dead>
;             t1 -> <dead>
;           data -> <dead>
;             t0 -> <dead>
;              i -> R10,R11
	.even
_Init_usb::
	xcall push_gset3
	.dbline -1
	.dbline 76
	.dbline 79
	ldi R16,<L61
	ldi R17,>L61
	xcall _Print_str
	.dbline 80
	xcall _CH375_PORT_INIT
	.dbline 82
	xcall _CH375LibInit
	tst R16
	brne L62
	.dbline 82
	.dbline 82
	ldi R16,<L64
	ldi R17,>L64
	xcall _Print_str
	.dbline 82
	xjmp L67
L62:
	.dbline 83
	ldi R16,<L65
	ldi R17,>L65
	xcall _Print_str
	xjmp L67
L66:
	.dbline 85
	xcall _xQueryInterrupt
L67:
	.dbline 85
	lds R24,_CH375DiskStatus
	cpi R24,2
	brne L66
	.dbline 86
	ldi R16,200
	ldi R17,0
	ldi R18,0
	ldi R19,0
	xcall _mDelaymS
	.dbline 88
	ldi R16,<L69
	ldi R17,>L69
	xcall _Print_str
	.dbline 90
	clr R10
	clr R11
	xjmp L73
L70:
	.dbline 91
	.dbline 92
	xcall _CH375DiskReady
	tst R16
	brne L74
	.dbline 92
	xjmp L72
L74:
	.dbline 93
L71:
	.dbline 90
	movw R24,R10
	adiw R24,1
	movw R10,R24
L73:
	.dbline 90
	movw R24,R10
	cpi R24,5
	ldi R30,0
	cpc R25,R30
	brlo L70
L72:
	.dbline 94
	ldi R16,<L76
	ldi R17,>L76
	xcall _Print_str
	.dbline 97
	ldi R16,<L77
	ldi R17,>L77
	xcall _Print_str
	.dbline 98
	xcall _CH375DiskSize
	clr R17
	xcall _Print_size
	.dbline 99
	ldi R16,<L78
	ldi R17,>L78
	xcall _Print_str
	.dbline -2
L60:
	xcall pop_gset3
	.dbline 0 ; func end
	ret
	.dbsym l usbsize 1 i
	.dbsym l t2 1 c
	.dbsym l t1 1 c
	.dbsym l data 1 c
	.dbsym l t0 1 c
	.dbsym r i 10 i
	.dbend
	.dbfunc e mStopIfError _mStopIfError fV
;         iError -> R20
	.even
_mStopIfError::
	xcall push_gset1
	mov R20,R16
	.dbline -1
	.dbline 104
	.dbline 105
	tst R20
	brne L80
	.dbline 105
	xjmp L79
L80:
	.dbline 106
	ldi R16,<L82
	ldi R17,>L82
	xcall _Print_str
	.dbline 107
	mov R16,R20
	clr R17
	xcall _Print_val
L83:
	.dbline 108
L84:
	.dbline 108
	xjmp L83
X4:
	.dbline -2
L79:
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r iError 20 c
	.dbend
	.dbfunc e write_block _write_block fV
;              i -> R20,R21
;             ps -> R20,R21
	.even
_write_block::
	xcall push_gset1
	movw R20,R16
	.dbline -1
	.dbline 111
	.dbline 113
	ldi R24,1
	sts _mCmdParam,R24
	.dbline 114
	sts _mCmdParam+8+1,R21
	sts _mCmdParam+8,R20
	.dbline 115
	xcall _CH375FileWriteX
	mov R20,R16
	clr R21
	.dbline -2
L86:
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r i 20 i
	.dbsym r ps 20 pc
	.dbend
	.dbfunc e close_make_file _close_make_file fV
;              i -> R20,R21
	.even
_close_make_file::
	xcall push_gset1
	.dbline -1
	.dbline 118
	.dbline 120
	ldi R24,1
	sts _mCmdParam,R24
	.dbline 121
	xcall _CH375FileClose
	mov R20,R16
	clr R21
	.dbline 122
	xcall _mStopIfError
	.dbline -2
L88:
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r i 20 i
	.dbend
	.dbfunc e make_newfile _make_newfile fV
;              i -> R20,R21
;       Filename -> R20,R21
	.even
_make_newfile::
	xcall push_gset1
	movw R20,R16
	.dbline -1
	.dbline 126
	.dbline 128
	ldi R16,<L90
	ldi R17,>L90
	xcall _Print_str
	.dbline 129
	movw R18,R20
	ldi R16,<_mCmdParam
	ldi R17,>_mCmdParam
	xcall _strcpy
	.dbline 130
	xcall _CH375FileCreate
	mov R20,R16
	clr R21
	.dbline 131
	xcall _mStopIfError
	.dbline 132
	ldi R16,<L91
	ldi R17,>L91
	xcall _Print_str
	.dbline -2
L89:
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r i 20 i
	.dbsym r Filename 20 pc
	.dbend
	.dbfunc e mp3_play _mp3_play fV
;             t2 -> <dead>
;             t1 -> <dead>
;           data -> <dead>
;             t0 -> <dead>
;             ps -> R20,R21
;   data_pointer -> R10,R11
;              i -> R22,R23
;              s -> R20,R21
	.even
_mp3_play::
	xcall push_gset3
	movw R20,R16
	sbiw R28,8
	.dbline -1
	.dbline 137
	.dbline 143
	xcall _show_clear
	.dbline 144
	clr R2
	clr R3
	std y+7,R3
	std y+6,R2
	ldi R24,<_play_menu
	ldi R25,>_play_menu
	std y+5,R25
	std y+4,R24
	ldi R24,2
	ldi R25,0
	std y+3,R25
	std y+2,R24
	ldi R24,192
	std y+1,R25
	std y+0,R24
	clr R18
	clr R19
	clr R16
	clr R17
	xcall _show_lcd
	.dbline 145
	clr R2
	clr R3
	std y+1,R3
	std y+0,R2
	ldi R18,3
	ldi R19,0
	movw R16,R20
	xcall _show_play
	.dbline 147
	movw R18,R20
	ldi R16,<_mCmdParam
	ldi R17,>_mCmdParam
	xcall _strcpy
	.dbline 149
	xcall _CH375FileOpen
	xjmp L94
X5:
	.dbline 152
L96:
	.dbline 153
L97:
	.dbline 153
	sbis 0x10,0
	rjmp L96
	.dbline 154
	.dbline 154
	.dbline 154
	cbi 0x12,2
	.dbline 154
	.dbline 154
	.dbline 155
	clr R22
	clr R23
	xjmp L102
L99:
	.dbline 156
	.dbline 157
	clr R16
	xcall _spiSend
	.dbline 158
	movw R24,R10
	adiw R24,1
	movw R10,R24
	.dbline 159
L100:
	.dbline 155
	subi R22,255  ; offset = 1
	sbci R23,255
L102:
	.dbline 155
	cpi R22,32
	ldi R30,0
	cpc R23,R30
	brlo L99
	.dbline 160
	.dbline 160
	sbi 0x12,2
	.dbline 160
	.dbline 160
	.dbline 161
	movw R24,R10
	cpi R24,255
	ldi R30,7
	cpc R25,R30
	brne L103
	.dbline 161
	xjmp L95
L103:
	.dbline 162
	.dbline 163
L94:
	.dbline 151
	movw R24,R10
	cpi R24,0
	ldi R30,8
	cpc R25,R30
	brlo L97
L95:
	.dbline 164
	xcall _SoftReset
	.dbline 166
	clr R2
	sts _keybuf,R2
	.dbline 166
	xjmp L106
L105:
	.dbline 168
	.dbline 169
	lds R24,_keybuf
	cpi R24,5
	brne L108
	.dbline 169
	xjmp L107
L108:
	.dbline 170
	ldi R24,<_mp3buf
	ldi R25,>_mp3buf
	sts _mCmdParam+8+1,R25
	sts _mCmdParam+8,R24
	.dbline 171
	ldi R24,1
	sts _mCmdParam,R24
	.dbline 172
	xcall _CH375FileReadX
	.dbline 173
	ldi R20,<_mp3buf
	ldi R21,>_mp3buf
	.dbline 174
	clr R10
	clr R11
	xjmp L112
X6:
	.dbline 176
L114:
	.dbline 177
L115:
	.dbline 177
	sbis 0x10,0
	rjmp L114
	.dbline 178
	.dbline 178
	cbi 0x12,2
	.dbline 178
	.dbline 178
	.dbline 179
	clr R22
	clr R23
	xjmp L120
L117:
	.dbline 180
	.dbline 181
	movw R30,R20
	ld R16,Z+
	movw R20,R30
	xcall _spiSend
	.dbline 182
	movw R24,R10
	adiw R24,1
	movw R10,R24
	.dbline 183
L118:
	.dbline 179
	subi R22,255  ; offset = 1
	sbci R23,255
L120:
	.dbline 179
	cpi R22,32
	ldi R30,0
	cpc R23,R30
	brlo L117
	.dbline 184
	.dbline 184
	sbi 0x12,2
	.dbline 184
	.dbline 184
	.dbline 185
	movw R24,R10
	cpi R24,0
	ldi R30,2
	cpc R25,R30
	brne L121
	.dbline 185
	xjmp L113
L121:
	.dbline 186
L112:
	.dbline 175
	movw R24,R10
	cpi R24,0
	ldi R30,2
	cpc R25,R30
	brlo L115
L113:
	.dbline 187
	lds R24,_mCmdParam
	cpi R24,1
	brsh L123
	.dbline 187
	xjmp L107
L123:
	.dbline 188
L106:
	.dbline 167
	xjmp L105
L107:
	.dbline 189
	xcall _CH375FileClose
	.dbline -2
L92:
	adiw R28,8
	xcall pop_gset3
	.dbline 0 ; func end
	ret
	.dbsym l t2 9 c
	.dbsym l t1 9 c
	.dbsym l data 9 c
	.dbsym l t0 9 c
	.dbsym r ps 20 pc
	.dbsym r data_pointer 10 s
	.dbsym r i 22 i
	.dbsym r s 20 pc
	.dbend
	.dbfunc e RecordAdpcm1003 _RecordAdpcm1003 fV
;             ii -> R12,R13
;              n -> y+4
;           temp -> y+0
;            idx -> R12,R13
;              w -> R14,R15
;       Filename -> R10,R11
	.even
_RecordAdpcm1003::
	xcall push_gset5
	movw R10,R16
	sbiw R28,8
	.dbline -1
	.dbline 197
	.dbline 198
	clr R12
	clr R13
	.dbline 199
	clr R14
	clr R15
	.dbline 199
	.dbline 203
	movw R16,R10
	xcall _make_newfile
	.dbline 204
	xcall _record_init
	.dbline 205
	xjmp L129
L126:
	.d

⌨️ 快捷键说明

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