📄 main.s
字号:
movw R16,R14
xcall _MMCFntHZ
movw R12,R16
.dbline 161
; PrintOneHZ(x,y,HzPt);
std y+1,R13
std y+0,R12
mov R18,R20
mov R16,R10
xcall _PrintOneHZ
.dbline 162
; y+=16;
subi R20,240 ; addi 16
.dbline 163
; }else if(Hz[i]<128 && Hz[i+1]<128) //有英文字符在里面
xjmp L19
L18:
.dbline 163
mov R12,R22
clr R13
ldd R0,y+13
ldd R1,y+14
add R12,R0
adc R13,R1
movw R30,R12
ldd R24,z+0
cpi R24,128
brsh L20
X6:
ldd R24,z+1
cpi R24,128
brsh L20
X7:
.dbline 164
; {
.dbline 165
; PrintAscStr(x,y,Hz+i,2);
ldi R24,2
std y+2,R24
mov R2,R22
clr R3
add R2,R0
adc R3,R1
std y+1,R3
std y+0,R2
mov R18,R20
mov R16,R10
xcall _PrintAscStr
.dbline 166
; y+=16;
subi R20,240 ; addi 16
.dbline 167
; }
L20:
L19:
.dbline 168
; if(y>=128) {y=0;x+=2;}
cpi R20,128
brlo L22
X8:
.dbline 168
.dbline 168
clr R20
.dbline 168
mov R24,R10
subi R24,254 ; addi 2
mov R10,R24
.dbline 168
L22:
.dbline 169
; if(x>7){x=0;}
ldi R24,7
cp R24,R10
brsh L24
X9:
.dbline 169
.dbline 169
clr R10
.dbline 169
L24:
.dbline 170
; }
L15:
.dbline 153
subi R22,254 ; addi 2
L17:
.dbline 153
ldd R0,y+21
cp R22,R0
brsh X11
xjmp L14
X11:
X10:
.dbline -2
L13:
.dbline 0 ; func end
adiw R28,3
xcall pop_xgsetF0FC
adiw R28,4
ret
.dbsym r HzPt 12 pc
.dbsym r x 10 c
.dbsym r y 20 c
.dbsym r i 22 c
.dbsym l Lens 21 c
.dbsym l y0 19 c
.dbsym l x0 17 c
.dbsym r buffp 14 pc
.dbsym l Hz 13 pc
.dbend
.dbfunc e ChangeVS1011Vol _ChangeVS1011Vol fV
; retry -> R20
; Tmp -> R10,R11
; Vol -> R10,R11
.even
_ChangeVS1011Vol::
xcall push_xgsetF03C
movw R10,R16
sbiw R28,3
.dbline -1
.dbline 174
; }
;
; void ChangeVS1011Vol(uchar *Vol) //调整播放音量
; {
.dbline 177
; unsigned char retry;
; unsigned int Tmp;
; PrintConstAscStr(0,0,ScreenStr12[11],16);
ldi R24,16
std y+2,R24
ldi R24,<_ScreenStr12+176
ldi R25,>_ScreenStr12+176
std y+1,R25
std y+0,R24
clr R18
clr R16
xcall _PrintConstAscStr
.dbline 178
; PrintConstAscStr(2,0,ScreenStr12[12],16);
ldi R24,16
std y+2,R24
ldi R24,<_ScreenStr12+192
ldi R25,>_ScreenStr12+192
std y+1,R25
std y+0,R24
clr R18
ldi R16,2
xcall _PrintConstAscStr
.dbline 179
; PrintConstAscStr(3,0,ScreenStr12[13],16);
ldi R24,16
std y+2,R24
ldi R24,<_ScreenStr12+208
ldi R25,>_ScreenStr12+208
std y+1,R25
std y+0,R24
clr R18
ldi R16,3
xcall _PrintConstAscStr
.dbline 180
; PrintConstAscStr(6,0,ScreenStr12[14],16);
ldi R24,16
std y+2,R24
ldi R24,<_ScreenStr12+224
ldi R25,>_ScreenStr12+224
std y+1,R25
std y+0,R24
clr R18
ldi R16,6
xcall _PrintConstAscStr
.dbline 181
; KeyIni();KeyInput();
in R24,0x18
ori R24,15
out 0x18,R24
.dbline 181
in R24,0x17
andi R24,240
out 0x17,R24
xjmp L32
L31:
.dbline 183
; while(1)
; {
.dbline 184
; if(KeySt02==0) //Volume++,减小音量
in R24,0x16
andi R24,2
out 0x16,R24
tst R24
brne L34
X12:
.dbline 185
; {
.dbline 187
; //等待该键释放
; Delay(200);
ldi R16,200
ldi R17,0
xcall _Delay
xjmp L37
L36:
.dbline 188
; while(KeySt02==0) Delay(200);
ldi R16,200
ldi R17,0
xcall _Delay
L37:
.dbline 188
in R24,0x16
andi R24,2
out 0x16,R24
tst R24
breq L36
X13:
.dbline 189
; (*Vol)++;
movw R30,R10
ldd R24,z+0
subi R24,255 ; addi 1
std z+0,R24
.dbline 190
; if((*Vol)>=255) *Vol=255;
cpi R24,255
brsh X24
xjmp L35
X24:
X14:
.dbline 190
ldi R24,255
std z+0,R24
.dbline 191
; }
xjmp L35
L34:
.dbline 192
; else if(KeySt03==0) //Volume--,增大音量
in R20,0x16
andi R20,4
out 0x16,R20
tst R20
brne L41
X15:
.dbline 193
; {
.dbline 195
; //等待该键释放
; Delay(200);
ldi R16,200
ldi R17,0
xcall _Delay
xjmp L44
L43:
.dbline 196
; while(KeySt03==0) Delay(200);
ldi R16,200
ldi R17,0
xcall _Delay
L44:
.dbline 196
in R20,0x16
andi R20,4
out 0x16,R20
tst R20
breq L43
X16:
.dbline 197
; (*Vol)--;
movw R30,R10
ldd R24,z+0
subi R24,1
std z+0,R24
.dbline 198
; if((*Vol)<=0) *Vol=0;
ldi R24,0
ldd R2,z+0
cp R24,R2
brsh X25
xjmp L42
X25:
X17:
.dbline 198
clr R2
std z+0,R2
.dbline 199
; }
xjmp L42
L41:
.dbline 200
; else if(KeySt04==0) //确定退出
in R20,0x16
andi R20,8
out 0x16,R20
tst R20
brne L48
X18:
.dbline 201
; {//等待该键释放
.dbline 202
; Delay(200);
ldi R16,200
ldi R17,0
xcall _Delay
xjmp L51
L50:
.dbline 203
; while(KeySt04==0) Delay(200);
ldi R16,200
ldi R17,0
xcall _Delay
L51:
.dbline 203
in R20,0x16
andi R20,8
out 0x16,R20
tst R20
breq L50
X19:
.dbline 205
; //保存音量到E2PROM
; E2PROM_Write(0,Vol,1);
ldi R24,1
std y+0,R24
movw R18,R10
clr R16
clr R17
xcall _E2PROM_Write
.dbline 206
; break;
xjmp L33
L48:
.dbline 208
; }
; else if(KeySt01==0) //取消退出
in R20,0x16
andi R20,1
out 0x16,R20
tst R20
brne L53
X20:
.dbline 209
; {//等待该键释放
.dbline 210
; Delay(200);
ldi R16,200
ldi R17,0
xcall _Delay
xjmp L56
L55:
.dbline 211
; while(KeySt01==0) Delay(200);
ldi R16,200
ldi R17,0
xcall _Delay
L56:
.dbline 211
in R20,0x16
andi R20,1
out 0x16,R20
tst R20
breq L55
X21:
.dbline 212
; *Vol=DefaultVolume; //恢复到默认值
ldi R24,7710
ldi R25,30
movw R30,R10
std z+0,R24
.dbline 214
; //保存音量到E2PROM
; E2PROM_Write(0,Vol,1);
ldi R24,1
std y+0,R24
movw R18,R30
clr R16
clr R17
xcall _E2PROM_Write
.dbline 215
; break;
xjmp L33
L53:
L42:
L35:
.dbline 218
; }
; //显示当前音量:
; DisplayNumChar(6,64,255-(*Vol),3);
ldi R24,3
std y+2,R24
movw R30,R10
ldd R2,z+0
clr R3
ldi R24,255
ldi R25,0
movw R4,R24
sub R4,R2
sbc R5,R3
std y+0,R4
ldi R18,64
ldi R16,6
xcall _DisplayNumChar
.dbline 219
; }
L32:
.dbline 182
xjmp L31
L33:
.dbline 221
; //选中Vs1011
; SPI_CS_Deassert(); //PB2=1,释放MMC/SD卡
sbi 0x18,4
.dbline 223
; //写入当前音量:
; retry=0;Tmp=(*Vol)*256+(*Vol);
clr R20
.dbline 223
movw R30,R10
ldd R10,z+0
clr R11
ldi R16,256
ldi R17,1
movw R18,R10
xcall empy16s
movw R2,R16
add R2,R10
adc R3,R11
movw R10,R2
xjmp L59
L58:
.dbline 225
; while(VS1011B_ReadCMD(0x0b) != Tmp)//设音量 //set Volume
; {
.dbline 226
; VS1011B_WriteCMD(0x0b,Tmp);
movw R18,R10
ldi R16,11
xcall _VS1011B_WriteCMD
.dbline 227
; if(retry++ >10 )
mov R22,R20
clr R23
subi R20,255 ; addi 1
ldi R24,10
cp R24,R22
brsh L61
X22:
.dbline 228
; {
.dbline 229
; PrintConstAscStr(7,0,ScreenStr12[15],16); //显示"音量设置错误"
ldi R24,16
std y+2,R24
ldi R24,<_ScreenStr12+240
ldi R25,>_ScreenStr12+240
std y+1,R25
std y+0,R24
clr R18
ldi R16,7
xcall _PrintConstAscStr
.dbline 230
; Delay(1000);
ldi R16,1000
ldi R17,3
xcall _Delay
.dbline 232
; //释放Vs1011
; VS1011B_DDR |= BIT(VS1011B_XCS)|BIT(VS1011B_XRESET); //XCS,XDCS=1
in R24,0x1a
ori R24,66
out 0x1a,R24
.dbline 233
; SPI_CS_Assert();
cbi 0x18,4
.dbline 234
; return ;
xjmp L26
L61:
.dbline 236
; }
; }
L59:
.dbline 224
ldi R16,11
xcall _VS1011B_ReadCMD
movw R12,R16
cp R16,R10
cpc R17,R11
brne L58
X23:
.dbline 238
; //释放Vs1011
; VS1011B_DDR |= BIT(VS1011B_XCS)|BIT(VS1011B_XRESET); //XCS,XDCS=1
in R24,0x1a
ori R24,66
out 0x1a,R24
.dbline 239
; SPI_CS_Assert();
cbi 0x18,4
.dbline -2
L26:
.dbline 0 ; func end
adiw R28,3
xjmp pop_xgsetF03C
.dbsym r retry 20 c
.dbsym r Tmp 10 i
.dbsym r Vol 10 pc
.dbend
.dbfunc e ChangeVS1011Bass _ChangeVS1011Bass fV
; retry -> R22
; SB_Amp -> R10
; Tmp -> R20,R21
; SB_Freq -> R22
; hl -> R12
; VBass -> y+13
.even
_ChangeVS1011Bass::
st -y,r17
st -y,r16
xcall push_xgsetF0FC
sbiw R28,3
.dbline -1
.dbline 243
; }
;
; void ChangeVS1011Bass(uchar *VBass) //调整播放音量
; {
.dbline 244
; unsigned char retry,hl=0;
clr R12
.dbline 248
; unsigned char SB_Amp,SB_Freq;
; unsigned int Tmp;
;
; PrintConstAscStr(0,0,ScreenStr12[16],16);
ldi R24,16
std y+2,R24
ldi R24,<_ScreenStr12+256
ldi R25,>_ScreenStr12+256
std y+1,R25
std y+0,R24
clr R18
clr R16
xcall _PrintConstAscStr
.dbline 249
; PrintConstAscStr(1,0,ScreenStr12[17],16);
ldi R24,16
std y+2,R24
ldi R24,<_ScreenStr12+272
ldi R25,>_ScreenStr12+272
std y+1,R25
std y+0,R24
clr R18
ldi R16,1
xcall _PrintConstAscStr
.dbline 250
; PrintConstAscStr(3,0,ScreenStr12[18],16);
ldi R24,16
std y+2,R24
ldi R24,<_ScreenStr12+288
ldi R25,>_ScreenStr12+288
std y+1,R25
std y+0,R24
clr R18
ldi R16,3
xcall _PrintConstAscStr
.dbline 251
; PrintConstAscStr(6,0,ScreenStr12[20],6);
ldi R24,6
std y+2,R24
ldi R24,<_ScreenStr12+320
ldi R25,>_ScreenStr12+320
std y+1,R25
std y+0,R24
clr R18
ldi R16,6
xcall _PrintConstAscStr
.dbline 252
; PrintConstAscStr(6,64,ScreenStr12[21],6);
ldi R24,6
std y+2,R24
ldi R24,<_ScreenStr12+336
ldi R25,>_ScreenStr12+336
std y+1,R25
std y+0,R24
ldi R18,64
ldi R16,6
xcall _PrintConstAscStr
.dbline 255
;
; //默认选中第一项:
; PrintOneASCII(0,0,'>');
ldi R24,62
std y+0,R24
clr R18
clr R16
xcall _PrintOneASCII
.dbline 256
; PrintOneASCII(1,0,' ');
ldi R24,32
std y+0,R24
clr R18
ldi R16,1
xcall _PrintOneASCII
.dbline 258
;
; SB_Amp=((*VBass)&0xF0)>>4; //取高四位
ldd R30,y+13
ldd R31,y+14
ldd R24,z+0
andi R24,240
swap R24
andi R24,#0x0F
mov R10,R24
.dbline 259
; SB_Freq=(*VBass)&0x0F;//取低四位
ldd R22,z+0
andi R22,15
.dbline 261
; //显示当前音量:
; DisplayNumChar(6,16,SB_Amp,2);
ldi R24,2
std y+2,R24
std y+0,R10
ldi R18,16
ldi R16,6
xcall _DisplayNumChar
.dbline 262
; DisplayNumChar(6,80,SB_Freq,2);
ldi R24,2
std y+2,R24
std y+0,R22
ldi R18,80
ldi R16,6
xcall _DisplayNumChar
.dbline 264
;
; KeyIni();KeyInput();
in R24,0x18
ori R24,15
out 0x18,R24
.dbline 264
in R24,0x17
andi R24,240
out 0x17,R24
xjmp L71
L70:
.dbline 266
; while(1)
; {
.dbline 267
; if(KeySt02==0) //--
in R24,0x16
andi R24,2
out 0x16,R24
tst R24
brne L73
X26:
.dbline 268
; {
.dbline 270
; //等待该键释放
; Delay(200);
ldi R16,200
ldi R17,0
xcall _Delay
xjmp L76
L75:
.dbline 271
; while(KeySt02==0) Delay(200);
ldi R16,200
ldi R17,0
xcall _Delay
L76:
.dbline 271
in R24,0x16
andi R24,2
out 0x16,R24
tst R24
breq L75
X27:
.dbline 272
; if(hl==0) SB_Amp=(--SB_Amp)&0x0F;
tst R12
brne L78
X28:
.dbline 272
mov R20,R10
subi R20,1
mov R24,R20
andi R24,15
mov R10,R24
xjmp L79
L78:
.dbline 274
; else
; {
.dbline 275
; SB_Freq=(--SB_Freq)&0x0F;
mov R20,R22
subi R20,1
mov R22,R20
andi R22,15
.dbline 276
; if(SB_Freq<2) SB_Freq=2;
cpi R22,2
brsh L80
X29:
.dbline 276
ldi R22,2
L80:
.dbline 277
; }
L79:
.dbline 279
; //显示当前音量:
; DisplayNumChar(6,16,SB_Amp,2);
ldi R24,2
std y+2,R24
std y+0,R10
ldi R18,16
ldi R16,6
xcall _DisplayNumChar
.dbline 280
; DisplayNumChar(6,80,SB_Freq,2);
ldi R24,2
std y+2,R24
std y+0,R22
ldi R18,80
ldi R16,6
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -