📄 main.lst
字号:
304 4 offsety_buff=offsety;
305 4
306 4 }
307 3 k=5;
308 3 }
309 2 if((k==0x01)&&((P3&0x04)==0x04))
310 2 {
311 3
312 3 offsety_buff=offsety;
313 3 ting=tingzhizuo(buff,offsetx,offsety);
314 3 if(!ting)
315 3 {
316 4 if(((*((moxing+((buff&0xf0)|((buff&0x0f)<<2)))+3))&0x0f)+offsety<=13)
317 4 offsety++;
318 4 k=5;
319 4 clearbuf(buff,offsetx_buff,offsety_buff);
320 4 playbuf(buff,offsetx,offsety);
321 4 offsety_buff=offsety;
322 4 }
323 3 }
324 2 if((k==0x03)&&((P3&0x04)==0x04))
325 2 {
326 3 dengji=36;/////////////
327 3 k=5;
328 3 }
329 2 if((k==0x00)&&((P3&0x04)==0x04))
330 2 {
331 3 uchar i;
332 3 k=5;
333 3 i=buff;
334 3 buff++;
335 3 if((buff&0x0f)>=4)
336 3 buff=buff&0xf0;
337 3
338 3 //change1(0,14);
339 3 if(((*(((moxing+((buff&0xf0)|((buff&0x0f)<<2)))+3))&0x0f)+offsety)>14)
340 3 {
341 4 do
342 4 {
343 5 offsety--;
344 5 }while((((*((moxing+((buff&0xf0)|((buff&0x0f)<<2)))+3))&0x0f)+offsety)>14);
345 4
346 4 }
347 3 if(((*((moxing+((buff&0xf0)|((buff&0x0f)<<2)))+2))&0x0f)+offsety<0)
348 3 {
349 4 do
350 4 {
351 5 offsety++;
352 5 }while(((*((moxing+((buff&0xf0)|((buff&0x0f)<<2)))+2))&0x0f)+offsety);
353 4 }
354 3 clearbuf(i,offsetx_buff,offsety_buff);
355 3 playbuf(buff,offsetx,offsety);
356 3 }
357 2 ting=tingzhixia(buff,offsetx,offsety);
358 2 while(flag5);
359 2 if(flag1)
360 2 {
361 3 offsetx_buff=offsetx;
C51 COMPILER V8.02 MAIN 05/24/2012 19:52:39 PAGE 7
362 3 offsety_buff=offsety;
363 3 offsetx++;
364 3 clearbuf(buff,offsetx_buff,offsety_buff);
365 3 playbuf(buff,offsetx,offsety);
366 3 offsetx_buff=offsetx;
367 3 flag1=0;
368 3 }
369 2 if((((((*((moxing+((buff&0xf0)+((buff&0x0f)<<2))+1)))&0xf0)>>4)+offsetx)>22)|ting)
370 2 {
371 3 uchar i=0;
372 3 if(hangman((((*((moxing+((buff&0xf0)+((buff&0x0f)<<2))+1)))&0xf0)>>4)+offsetx))
373 3 {xiaohang((((*((moxing+((buff&0xf0)+((buff&0x0f)<<2))+1)))&0xf0)>>4)+offsetx);fenshu++;i++;}
374 3
375 3 if((((*((moxing+((buff&0xf0)|((buff&0x0f)<<2)))+2))&0xf0)>>4)+offsetx>=(((*((moxing+((buff&0xf0)|((buff&0
-x0f)<<2)))+3))&0xf0)>>4)+offsetx) //x2>=x3
376 3 {
377 4 if((((*((moxing+((buff&0xf0)|((buff&0x0f)<<2)))+2))&0xf0)>>4)+offsetx<(((*((moxing+((buff&0xf0)|((buff&0
-x0f)<<2))+1)))&0xf0)>>4)+offsetx) //x2<x1
378 4 {
379 5 if(hangman((((*((moxing+((buff&0xf0)+((buff&0x0f)<<2))+2)))&0xf0)>>4)+offsetx+i))
380 5 {xiaohang((((*((moxing+((buff&0xf0)+((buff&0x0f)<<2))+2)))&0xf0)>>4)+offsetx+i);fenshu++;i++;}
381 5 }
382 4 if((((*((moxing+((buff&0xf0)|((buff&0x0f)<<2)))+3))&0xf0)>>4)+offsetx<(((*((moxing+((buff&0xf0)|((buff&0
-x0f)<<2)))+2))&0xf0)>>4)+offsetx) //x3<x2
383 4 {
384 5 if(hangman((((*((moxing+((buff&0xf0)+((buff&0x0f)<<2))+3)))&0xf0)>>4)+offsetx+i))
385 5 {xiaohang((((*((moxing+((buff&0xf0)+((buff&0x0f)<<2))+3)))&0xf0)>>4)+offsetx+i);fenshu++;i++;}
386 5 }
387 4 if((((*(moxing+((buff&0xf0)|((buff&0x0f)<<2))))&0xf0)>>4)+offsetx<(((*((moxing+((buff&0xf0)|((buff&0x0f)
-<<2)))+3))&0xf0)>>4)+offsetx) //x0<x3
388 4 {
389 5 if(hangman((((*(moxing+((buff&0xf0)+((buff&0x0f)<<2))))&0xf0)>>4)+offsetx+i))
390 5 {xiaohang((((*(moxing+((buff&0xf0)+((buff&0x0f)<<2))))&0xf0)>>4)+offsetx+i);fenshu++;i++;}
391 5 }
392 4 }
393 3 if((((*((moxing+((buff&0xf0)|((buff&0x0f)<<2)))+2))&0xf0)>>4)+offsetx<(((*((moxing+((buff&0xf0)|((buff&0x
-0f)<<2)))+3))&0xf0)>>4)+offsetx) //x2<x3
394 3 {
395 4 if((((*((moxing+((buff&0xf0)|((buff&0x0f)<<2)))+3))&0xf0)>>4)+offsetx<(((*((moxing+((buff&0xf0)|((buff
-&0x0f)<<2))+1)))&0xf0)>>4)+offsetx)
396 4 {
397 5 if(hangman((((*((moxing+((buff&0xf0)+((buff&0x0f)<<2))+3)))&0xf0)>>4)+offsetx+i))
398 5 {xiaohang((((*((moxing+((buff&0xf0)+((buff&0x0f)<<2))+3)))&0xf0)>>4)+offsetx+i);fenshu++;i++;}
399 5 }
400 4 if(hangman((((*((moxing+((buff&0xf0)+((buff&0x0f)<<2))+2)))&0xf0)>>4)+offsetx+i))
401 4 {xiaohang((((*((moxing+((buff&0xf0)+((buff&0x0f)<<2))+2)))&0xf0)>>4)+offsetx+i);fenshu++;i++;}
402 4 if((((*(moxing+((buff&0xf0)|((buff&0x0f)<<2))))&0xf0)>>4)+offsetx<(((*((moxing+((buff&0xf0)|((buff&0x0
-f)<<2)))+2))&0xf0)>>4)+offsetx)
403 4 {
404 5 if(hangman((((*(moxing+((buff&0xf0)+((buff&0x0f)<<2))))&0xf0)>>4)+offsetx+i))
405 5 {xiaohang((((*(moxing+((buff&0xf0)+((buff&0x0f)<<2))))&0xf0)>>4)+offsetx+i);fenshu++;i++;}
406 5 }
407 4 }
408 3
409 3 play8(0,0,3,shu0+((fenshu/10)<<4));
410 3 play8(0,1,3,shu0+((fenshu%10)<<4));
411 3 dengji=fenshu/5;
412 3 if(((((*(moxing+((buff&0xf0)+((buff&0x0f)<<2))))&0xf0)>>4)+offsetx)<1)
413 3 {
414 4
415 4 delay1ms(450);
416 4 delay1ms(450);
C51 COMPILER V8.02 MAIN 05/24/2012 19:52:39 PAGE 8
417 4 choose12864(2);
418 4 clear12864();
419 4 play16(0,4,1,over);
420 4 play16(0,6,1,over+32);
421 4 play16(1,0,1,over+64);
422 4 play16(1,2,1,over+96);
423 4 delay1ms(450);
424 4 delay1ms(450);
425 4 break;
426 4 }
427 3 buff=(((TL0%7)<<4)|(TH0%4));
428 3 //buff=0x11;
429 3 offsety=7;
430 3 offsetx=-3;
431 3 offsetx_buff=-9;
432 3 offsety_buff=-9;
433 3 }
434 2 }
435 1
436 1 }
437
438
439 /*万年历子程序*/
440 void wannianli(void)
441 {
442 1 uchar i;
443 1 uchar count1=0;
444 1 k=0;
445 1 choose12864(2);
446 1 init12864();
447 1 clear12864();
448 1 play8(0,0,0,shu2); //屏,列,页,地址
449 1 play8(0,1,0,shu0);
450 1 play16(0,4,0,nian);
451 1 play16(1,0,0,yue);
452 1 play16(1,4,0,ri);
453 1 play16(0,2,1,shi);
454 1 play16(0,6,1,fen);
455 1 play16(1,2,1,miao);
456 1
457 1 play16(1,0,2,xing);
458 1 play16(1,2,2,qi);
459 1 vertical(3,63,127);
460 1 vertical(3,63,126);
461 1 vertical(3,63,122);
462 1 vertical(3,63,121);
463 1 for(i=0;i<7;i++)
464 1 {
465 2 dot(121+i,3);
466 2 dot(121+i,63);
467 2 }
468 1 for(i=0;i<12;i++)
469 1 {
470 2 dot(123,8+5*i);
471 2 }
472 1 for(i=0;i<7;i++)
473 1 {
474 2 if(i<4)
475 2 {
476 3 play16(0,i<<1,3,yanyu+(i<<5));
477 3 }
478 2 if(i>=4)
C51 COMPILER V8.02 MAIN 05/24/2012 19:52:39 PAGE 9
479 2 {
480 3 play16(1,(i-4)<<1,3,yanyu+(i<<5));
481 3 }
482 2 }
483 1 init_ds1302();
484 1 init_time();
485 1 flag5=0;
486 1 do
487 1 {
488 2 if(P3&0x04)
489 2 first=1;
490 2 init_ds1302();
491 2 gettime(&realtime);
492 2 play8(0,2,0,(shu0+(datastring[0]<<4)));
493 2 play8(0,3,0,(shu0+(datastring[1]<<4)));
494 2 play8(0,6,0,(shu0+(datastring[2]<<4)));
495 2 play8(0,7,0,(shu0+(datastring[3]<<4)));
496 2 play8(1,2,0,(shu0+(datastring[4]<<4)));
497 2 play8(1,3,0,(shu0+(datastring[5]<<4)));
498 2 play8(0,0,1,(shu0+(datastring[6]<<4)));
499 2 play8(0,1,1,(shu0+(datastring[7]<<4)));
500 2 play8(0,4,1,(shu0+(datastring[8]<<4)));
501 2 play8(0,5,1,(shu0+(datastring[9]<<4)));
502 2 play8(1,0,1,(shu0+(datastring[10]<<4)));
503 2 play8(1,1,1,(shu0+(datastring[11]<<4)));
504 2 play16(1,4,2,(yi+((datastring[12]-2)<<5)));
505 2 gettemperature();
506 2 if(flagg)
507 2 {
508 3 play8(0,0,2,fu);
509 3 play8(1,6,3,fu);
510 3 }
511 2 else
512 2 {
513 3 clear8(6,4,0);
514 3 play8(1,6,3,zheng);
515 3 }
516 2 play8(0,4+flagg,2,dian);
517 2 play8(0,5+flagg,2,C);
518 2 play8(0,0+flagg,2,(shu0+(temp[0]<<4)));
519 2 play8(0,1+flagg,2,(shu0+(temp[1]<<4)));
520 2 play8(0,2+flagg,2,xiao);
521 2 play8(0,3+flagg,2,(shu0+(temp[2]<<4)));
522 2 play();
523 2 dot(124,3);
524 2 if((k==0x02)&&((P3&0x04)==0x04))
525 2 {
526 3 count1++;
527 3 if(count1==7)
528 3 count1=0;
529 3 switch (count1)
530 3 {
531 4 case 0:
532 4 {
533 5 play16(1,0,2,xing);
534 5 play16(1,2,2,qi);
535 5 k=0;break;
536 5 }
537 4
538 4 case 1:
539 4 {
540 5 play16_fb(0,4,0);
C51 COMPILER V8.02 MAIN 05/24/2012 19:52:39 PAGE 10
541 5 k=0; break;
542 5 }
543 4 case 2:
544 4 {
545 5 play16(0,4,0,nian);
546 5 play16_fb(1,0,0);
547 5 k=0;break;
548 5 }
549 4 case 3:
550 4 {
551 5 play16(1,0,0,yue);
552 5 play16_fb(1,4,0);
553 5 k=0;break;
554 5 }
555 4 case 4:
556 4 {
557 5 play16(1,4,0,ri);
558 5 play16_fb(0,2,1);
559 5 k=0;break;
560 5 }
561 4 case 5:
562 4 {
563 5 play16(0,2,1,shi);
564 5 play16_fb(0,6,1);
565 5 k=0;break;
566 5 }
567 4 case 6:
568 4 {
569 5 play16(0,6,1,fen);
570 5 play16_fb(1,0,2);
571 5 play16_fb(1,2,2);
572 5 k=0;break;
573 5 }
574 4 default:k=0;break;
575 4 }
576 3 }
577 2 if((k==0x03)&&((P3&0x04)==0x04))
578 2 {
579 3 switch(count1)
580 3 {
581 4 case 1:
582 4 {
583 5 setjia(ds1302_year);k=0;break;
584 5 }
585 4 case 2:
586 4 {
587 5 setjia(ds1302_month);k=0;break;
588 5 }
589 4 case 3:
590 4 {
591 5 setjia(ds1302_day);k=0;break;
592 5 }
593 4 case 4:
594 4 {
595 5 setjia(ds1302_hour);k=0;break;
596 5 }
597 4 case 5:
598 4 {
599 5 setjia(ds1302_minute);k=0;break;
600 5 }
601 4 case 6:
602 4 {
C51 COMPILER V8.02 MAIN 05/24/2012 19:52:39 PAGE 11
603 5 setjia(ds1302_week);k=0;break;
604 5 }
605 4 }
606 3 }
607 2 if((k==0x01)&&((P3&0x04)==0x04))
608 2 {
609 3 switch(count1)
610 3 {
611 4 case 1:
612 4 {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -