📄 playedit.s
字号:
std y+1,R25
std y+0,R24
ldi R18,56
ldi R19,0
ldi R16,3
ldi R17,0
xcall _show_lcd
.dbline 424
; show_lcd(6, 56, 80, 2, &del_tab[0], 0);
clr R2
clr R3
std y+7,R3
std y+6,R2
ldi R24,<_del_tab
ldi R25,>_del_tab
std y+5,R25
std y+4,R24
ldi R24,2
ldi R25,0
std y+3,R25
std y+2,R24
ldi R24,80
std y+1,R25
std y+0,R24
ldi R18,56
ldi R19,0
ldi R16,6
ldi R17,0
xcall _show_lcd
.dbline 425
; switch(ii)
mov R14,R22
clr R15
tst R14
brne X28
tst R15
breq L282
X28:
movw R24,R14
cpi R24,1
ldi R30,0
cpc R25,R30
breq L283
cpi R24,2
ldi R30,0
cpc R25,R30
breq L284
xjmp L279
X29:
.dbline 426
; {
L282:
.dbline 427
; case 0: show_lcd(0, 56, 80, 2, &show_tab[0],1);
ldi R24,1
ldi R25,0
std y+7,R25
std y+6,R24
ldi R24,<_show_tab
ldi R25,>_show_tab
std y+5,R25
std y+4,R24
ldi R24,2
ldi R25,0
std y+3,R25
std y+2,R24
ldi R24,80
std y+1,R25
std y+0,R24
ldi R18,56
ldi R19,0
clr R16
clr R17
xcall _show_lcd
.dbline 428
; break;
xjmp L280
L283:
.dbline 429
; case 1: show_lcd(3, 56, 80, 2, &add_tab[0],1);
ldi R24,1
ldi R25,0
std y+7,R25
std y+6,R24
ldi R24,<_add_tab
ldi R25,>_add_tab
std y+5,R25
std y+4,R24
ldi R24,2
ldi R25,0
std y+3,R25
std y+2,R24
ldi R24,80
std y+1,R25
std y+0,R24
ldi R18,56
ldi R19,0
ldi R16,3
ldi R17,0
xcall _show_lcd
.dbline 430
; break;
xjmp L280
L284:
.dbline 431
; case 2: show_lcd(6, 56, 80, 2, &del_tab[0],1);
ldi R24,1
ldi R25,0
std y+7,R25
std y+6,R24
ldi R24,<_del_tab
ldi R25,>_del_tab
std y+5,R25
std y+4,R24
ldi R24,2
ldi R25,0
std y+3,R25
std y+2,R24
ldi R24,80
std y+1,R25
std y+0,R24
ldi R18,56
ldi R19,0
ldi R16,6
ldi R17,0
xcall _show_lcd
.dbline 432
; }
L279:
L280:
.dbline 433
; KEYBUF_NULL;
clr R2
sts _keybuf,R2
.dbline 433
L285:
.dbline 434
L286:
.dbline 434
; while(keybuf == NULL);
lds R2,_keybuf
tst R2
breq L285
.dbline 435
mov R24,R2
cpi R24,1
brne L288
.dbline 435
.dbline 435
mov R24,R22
subi R24,255 ; addi 1
mov R22,R24
cpi R22,3
brne L291
clr R22
xjmp L291
L291:
.dbline 435
; if(keybuf == K_DOWN){(++ii == 3) ? (ii = 0) : 0;}
L288:
.dbline 436
lds R24,_keybuf
cpi R24,3
brne L292
.dbline 436
.dbline 436
mov R24,R22
subi R24,1
mov R22,R24
cpi R22,255
brne L295
ldi R22,2
xjmp L295
L295:
.dbline 436
; if(keybuf == K_UP){(--ii == 255) ? (ii = 2) : 0;}
L292:
.dbline 437
; if(keybuf == K_ESC) break;
lds R24,_keybuf
cpi R24,5
brne L296
.dbline 437
xjmp L278
L296:
.dbline 438
; if(keybuf != K_ENTER) continue;
lds R24,_keybuf
cpi R24,4
breq L298
.dbline 438
xjmp L277
L298:
.dbline 439
; switch(ii)
mov R12,R22
clr R13
tst R12
brne X30
tst R13
breq L303
X30:
movw R24,R12
cpi R24,1
ldi R30,0
cpc R25,R30
breq L304
cpi R24,2
ldi R30,0
cpc R25,R30
breq L305
xjmp L300
X31:
.dbline 440
; {
L303:
.dbline 441
; case 0: adjust_cheng(1); //手动操作打开MP3通道
ldi R16,1
ldi R17,0
xcall _adjust_cheng
.dbline 442
; Play_Edit(data);
mov R16,R20
xcall _Play_Edit
.dbline 443
; adjust_cheng(0); //
clr R16
clr R17
xcall _adjust_cheng
.dbline 444
; break;
xjmp L301
L304:
.dbline 445
; case 1: Edit_add(data);
mov R16,R20
xcall _Edit_add
.dbline 446
; break;
xjmp L301
L305:
.dbline 447
; case 2: Del_Edit(data);
mov R16,R20
xcall _Del_Edit
.dbline 448
; break;
L300:
L301:
.dbline 450
clr R2
sts _keybuf,R2
.dbline 450
.dbline 451
L277:
.dbline 420
xjmp L276
L278:
.dbline 452
xcall _show_clear
.dbline 453
L224:
.dbline 366
xjmp L223
L225:
.dbline -2
L222:
adiw R28,8
xcall pop_gset5
.dbline 0 ; func end
ret
.dbsym r data 20 c
.dbsym r ii 22 c
.dbend
.area data(ram, con, rel)
.dbfile E:\software\MP3程序\PlayEdit\playedit.c
L307:
.blkb 1
.area idata
.byte 0
.area data(ram, con, rel)
.dbfile E:\software\MP3程序\PlayEdit\playedit.c
.area text(rom, con, rel)
.dbfile E:\software\MP3程序\PlayEdit\playedit.c
.dbfunc e autoplay _autoplay fV
.dbsym s index L307 c
; data -> R10
; point -> R10,R11
; timeplay -> y+38
; timenow -> y+34
; FILE -> y+2
; temp -> R10
; time -> R12,R13
.even
_autoplay::
xcall push_gset4
movw R12,R16
sbiw R28,42
.dbline -1
.dbline 460
; }
; KEYBUF_NULL;
; }//while(1)
; show_clear();
; }//while(1)
; }
; /*****************************************************************************
; *根据当前时间查看需要自动播放的文件,并播放
; /*****************************************************************************/
; #define MAXINDEX 8
; void autoplay(struct time_now *time)
; {
.dbline 468
; static uchar index=0; //记录索引号
; struct fileinfor FILE;
; unsigned long int timenow;
; unsigned long int timeplay;
; uchar temp;
; uint point;
; uchar data;
; Print_str("Run outplay test\r\n");
ldi R16,<L308
ldi R17,>L308
xcall _Print_str
.dbline 469
; data = time->week;
movw R30,R12
ldd R10,z+5
.dbline 470
; data -= 1;
dec R10
.dbline 471
; point = 8*data*sizeof(FILE); //得到当前日期的地址
ldi R24,8
mul R24,R10
ldi R24,32
mul R24,R0
movw R10,R0
.dbline 472
; point += sizeof(FILE); //指向记录的第一条
movw R24,R10
adiw R24,32
movw R10,R24
.dbline 473
; point += index*sizeof(FILE); //指向当前记录条
lds R2,L307
ldi R24,32
mul R24,R2
add R10,R0
adc R11,R1
.dbline 474
; EEPROMReadBytes(point,&FILE,sizeof(FILE)); //读取记录
clr R25
std y+1,R25
std y+0,R24
movw R18,R28
subi R18,254 ; offset = 2
sbci R19,255
movw R16,R10
xcall _EEPROMReadBytes
.dbline 475
; if(++index >= MAXINDEX) index = 0;
lds R24,L307
subi R24,255 ; addi 1
mov R2,R24
sts L307,R2
cpi R24,8
brlo L309
.dbline 475
clr R2
sts L307,R2
L309:
.dbline 476
; if(FILE.active != 0x55) return; //已经被删除的记录则返回
ldd R24,y+30
cpi R24,85
breq L311
.dbline 476
xjmp L306
L311:
.dbline 477
; if(FILE.filename[0] != 0x5c) return; //没有正确的文件名返回
ldd R24,y+2
cpi R24,92
breq L314
.dbline 477
xjmp L306
L314:
.dbline 478
; Print_str("Run outplay test time\r\n");
ldi R16,<L316
ldi R17,>L316
xcall _Print_str
.dbline 480
; //计算当前时间得到秒
; temp = time->hour;
movw R30,R12
ldd R10,z+2
.dbline 481
; temp >>= 4;
mov R24,R10
swap R24
andi R24,#0x0F
.dbline 482
; temp = (temp&0x0f)*10;
andi R24,15
ldi R25,10
mul R25,R24
mov R10,R0
.dbline 483
; temp += (0x0f&time->hour);
movw R30,R12
ldd R24,z+2
andi R24,15
add R10,R24
.dbline 484
; timenow = temp*3600;
mov R18,R10
clr R19
ldi R16,3600
ldi R17,14
xcall empy16s
movw R2,R16
clr R4
sbrc R3,7
com R4
clr R5
sbrc R4,7
com R5
movw R30,R28
std z+34,R2
std z+35,R3
std z+36,R4
std z+37,R5
.dbline 486
;
; temp = time->min;
movw R30,R12
ldd R10,z+1
.dbline 487
; temp >>= 4;
mov R24,R10
swap R24
andi R24,#0x0F
.dbline 488
; temp = (temp&0x0f)*10;
andi R24,15
ldi R25,10
mul R25,R24
mov R10,R0
.dbline 489
; temp += (0x0f&time->min);
movw R30,R12
ldd R24,z+1
andi R24,15
add R10,R24
.dbline 490
; timenow += temp*60;
ldi R24,60
mul R24,R10
movw R2,R0
clr R4
sbrc R3,7
com R4
clr R5
sbrc R4,7
com R5
movw R30,R28
ldd R6,z+34
ldd R7,z+35
ldd R8,z+36
ldd R9,z+37
add R6,R2
adc R7,R3
adc R8,R4
adc R9,R5
movw R30,R28
std z+34,R6
std z+35,R7
std z+36,R8
std z+37,R9
.dbline 492
;
; temp = time->sec;
movw R30,R12
ldd R10,z+0
.dbline 493
; temp >>= 4;
mov R24,R10
swap R24
andi R24,#0x0F
.dbline 494
; temp = (temp&0x0f)*10;
andi R24,15
mul R25,R24
mov R10,R0
.dbline 495
; temp += (0x0f&time->sec);
ldd R24,z+0
andi R24,15
add R10,R24
.dbline 496
; timenow += temp;
mov R2,R10
clr R3
clr R4
clr R5
movw R30,R28
ldd R6,z+34
ldd R7,z+35
ldd R8,z+36
ldd R9,z+37
add R6,R2
adc R7,R3
adc R8,R4
adc R9,R5
movw R30,R28
std z+34,R6
std z+35,R7
std z+36,R8
std z+37,R9
.dbline 498
; //计算设置时间得到秒
; temp = FILE.hour;
ldd R10,y+31
.dbline 499
; temp >>= 4;
mov R24,R10
swap R24
andi R24,#0x0F
.dbline 500
; temp = (temp&0x0f)*10;
andi R24,15
mul R25,R24
mov R10,R0
.dbline 501
; temp += (0x0f&FILE.hour);
ldd R24,y+31
andi R24,15
add R10,R24
.dbline 502
; timeplay = temp*3600;
mov R18,R10
clr R19
ldi R16,3600
ldi R17,14
xcall empy16s
movw R2,R16
clr R4
sbrc R3,7
com R4
clr R5
sbrc R4,7
com R5
movw R30,R28
std z+38,R2
std z+39,R3
std z+40,R4
std z+41,R5
.dbline 504
;
; temp = FILE.min;
ldd R10,y+32
.dbline 505
; temp >>= 4;
mov R24,R10
swap R24
andi R24,#0x0F
.dbline 506
; temp = (temp&0x0f)*10;
andi R24,15
ldi R25,10
mul R25,R24
mov R10,R0
.dbline 507
; temp += (0x0f&FILE.min);
ldd R24,y+32
andi R24,15
add R10,R24
.dbline 508
; timeplay += temp*60;
ldi R24,60
mul R24,R10
movw R2,R0
clr R4
sbrc R3,7
com R4
clr R5
sbrc R4,7
com R5
movw R30,R28
ldd R6,z+38
ldd R7,z+39
ldd R8,z+40
ldd R9,z+41
add R6,R2
adc R7,R3
adc R8,R4
adc R9,R5
movw R30,R28
std z+38,R6
std z+39,R7
std z+40,R8
std z+41,R9
.dbline 510
;
; temp = FILE.sec;
ldd R10,y+33
.dbline 511
; temp >>= 4;
mov R24,R10
swap R24
andi R24,#0x0F
.dbline 512
; temp = (temp&0x0f)*10;
andi R24,15
mul R25,R24
mov R10,R0
.dbline 513
; temp += (0x0f&FILE.sec);
ldd R24,y+33
andi R24,15
add R10,R24
.dbline 514
; timeplay += temp;
mov R2,R10
clr R3
clr R4
clr R5
movw R30,R28
ldd R6,z+38
ldd R7,z+39
ldd R8,z+40
ldd R9,z+41
add R6,R2
adc R7,R3
adc R8,R4
adc R9,R5
movw R30,R28
std z+38,R6
std z+39,R7
std z+40,R8
std z+41,R9
.dbline 516
;
; Print_str("Run outplay test ok\r\n");
ldi R16,<L323
ldi R17,>L323
xcall _Print_str
.dbline 517
; if(timenow < timeplay) return; //测试播放条件是否成立
movw R30,R28
ldd R2,z+38
ldd R3,z+39
ldd R4,z+40
ldd R5,z+41
movw R30,R28
ldd R6,z+34
ldd R7,z+35
ldd R8,z+36
ldd R9,z+37
cp R6,R2
cpc R7,R3
cpc R8,R4
cpc R9,R5
brsh L324
.dbline 517
xjmp L306
L324:
.dbline 518
; if(timenow > (timeplay+5)) return; //5秒误差均可以播放
ldi R20,5
ldi R21,0
ldi R22,0
ldi R23,0
movw R30,R28
ldd R2,z+38
ldd R3,z+39
ldd R4,z+40
ldd R5,z+41
add R2,R20
adc R3,R21
adc R4,R22
adc R5,R23
movw R30,R28
ldd R6,z+34
ldd R7,z+35
ldd R8,z+36
ldd R9,z+37
cp R2,R6
cpc R3,R7
cpc R4,R8
cpc R5,R9
brsh L326
.dbline 518
xjmp L306
L326:
.dbline 519
; if(EEPROMread(2047) != 0) return; //MP3输出是否有效
ldi R16,2047
ldi R17,7
xcall _EEPROMread
tst R16
breq L328
.dbline 519
xjmp L306
L328:
.dbline 520
; adjust_cheng(1); //开功放
ldi R16,1
ldi R17,0
xcall _adjust_cheng
.dbline 521
; mp3_play(&FILE.filename[0],0); //播放设定的文件
clr R18
clr R19
movw R16,R28
subi R16,254 ; offset = 2
sbci R17,255
xcall _mp3_play
.dbline 522
; adjust_cheng(0); //关功放
clr R16
clr R17
xcall _adjust_cheng
.dbline 523
; show_clear();
xcall _show_clear
.dbline 524
; show_status(); //播放起空闲的状态
xcall _show_status
.dbline -2
L306:
adiw R28,42
xcall pop_gset4
.dbline 0 ; func end
ret
.dbsym r data 10 c
.dbsym r point 10 i
.dbsym l timeplay 38 l
.dbsym l timenow 34 l
.dbsym l FILE 2 X
.dbsym r temp 10 c
.dbsym r time 12 pX
.dbend
.area lit(rom, con, rel)
_path_menu::
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 32,33
.byte 230,0
.byte 0,34
.byte 170,170
.byte 170,191
.byte 170,170
.byte 34,32
.byte 0,32
.byte 34,228
.byte 12,64
.byte 'P,'N
.byte 200,127
.byte 200,'H
.byte 'L,'H
.byte 64,0
.byte 8,8
.byte 136,255
.byte 'H,8
.byte 'B,'F
.byte 42,210
.byte 42,39
.byte 'B,64
.byte 0,0
.byte 4,4
.byte 4,4
.byte 4,252
.byte 4,4
.byte 4,4
.byte 6,4
.byte 0,0
.byte 64,32
.byte 16,252
.byte 3,32
.byte 16,12
.byte 251,'H
.byte 'H,'H
.byte 'L,8
.byte 0,0
.byte 0,0
.byte 254,34
.byte 34,34
.byte 34,34
.byte 34,255
.byte 2,0
.byte 0,0
.byte 32,32
.byte 162,170
.byte 42,42
.byte 42,234
.byte 42,42
.byte 63,162
.byte 32,32
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.by
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -