?? main.c
字號:
//======================================================
// The information contained herein is the exclusive property of
// Sunnnorth Technology Co. And shall not be distributed, reproduced,
// or disclosed in whole in part without prior written permission.
// (C) COPYRIGHT 2003 SUNNORTH TECHNOLOGY CO.
// ALL RIGHTS RESERVED
// The entire notice above must be reproduced on all authorized copies.
//========================================================
//============================================================
// 工程名稱:LCD_DynamicGraphic.spj
// 功能描述: 飛翔的小鳥,并有背景音樂
//
// 文件來源:《實驗儀實驗指導書》 實驗三十六 帶有背景音樂的動態圖片 第131頁
//
// IDE環境: SUNPLUS u'nSPTM IDE 1.8.4
//
// 涉及的庫:
//
// 組成文件:
// SPLC501hardware.asm/SPLC501sys.asm/SPLC501var.asm
// splc501c.inc/splc501c_io.inc/hardware.inc/lab_parameter.h
//
//===============================================
//============================================================
// 文件名稱:main.c
// 實現功能: 飛翔的小鳥,并有背景音樂
//============================================================
#include "lab_parameter.h"
#include "sacmv32.h"
extern BIRD_Frame0;
extern BIRD_Frame1;
extern BIRD_Frame2;
extern BIRD_Frame3;
extern BIRD_Frame4;
extern BIRD_Frame5;
extern BIRD_Frame6;
//=============================================================
// 函數名稱: int main()
// 功能描述: 飛翔的小鳥,并有背景音樂
// 語法格式: int main()
//入口參數: 無
// 出口參數: 無
// 注意事項: 僅為用戶模型
//=============================================================
main()
{
int i,j,x=60;
Init_sys(); // 初始化系統時鐘
FG_InitGraphic(); //初始化LCDIO口 函數定義在Splc501sys.asm
FG_SetBMPMode(DG_BMP_COVER); //設置位圖模式 函數定義在Splc501sys.asm
FG_ClearScreen(1); //點亮整個顯示屏 函數定義在Splc501sys.asm
for(j=0;j<=2;j++) //延時 保持整個顯示屏點亮
for(i=0;i<0xffff;i++)
Clear_Watch_Dog(); //清看門狗 函數定義在Splc501sys.asm
SACM_A2000_Initial(Auto); //A2000播放初始化 函數包含在Sacmv32.lib
SACM_A2000_Play(0,DAC1+DAC2,Ramp_Up_On+Ramp_Dn_On); //A2000語音播放 函數包含在Sacmv32.lib
loop:
if((SACM_A2000_Status()&0x01) == 0) //判斷語音是否播放結束 函數包含在Sacmv32.lib
SACM_A2000_Play(0,DAC1+DAC2,Ramp_Up_On+Ramp_Dn_On);//語音播放 函數包含在Sacmv32.lib
x=x+5;
if(x==128) x=60;
FG_PutBitmap(&BIRD_Frame0,x,60);
for(j=0;j<=2;j++) //延時 保持整個顯示屏點亮
for(i=0;i<0xffff;i++)
Clear_Watch_Dog(); //清看門狗 函數定義在Splc501sys.asm
FG_ClearScreen(0);
x++;
if(x==128) x=60;
FG_PutBitmap(&BIRD_Frame1,x,60);
for(j=0;j<=2;j++) //延時 保持整個顯示屏點亮
for(i=0;i<0xffff;i++)
Clear_Watch_Dog(); //清看門狗 函數定義在Splc501sys.asm
FG_ClearScreen(0);
x++;
if(x==128) x=60;
FG_PutBitmap(&BIRD_Frame2,x,60);
for(j=0;j<=2;j++) //延時 保持整個顯示屏點亮
for(i=0;i<0xffff;i++)
Clear_Watch_Dog(); //清看門狗 函數定義在Splc501sys.asm
FG_ClearScreen(0);
x++;
if(x==128) x=60;
FG_PutBitmap(&BIRD_Frame3,x,60);
for(j=0;j<=2;j++) //延時 保持整個顯示屏點亮
for(i=0;i<0xffff;i++)
Clear_Watch_Dog(); //清看門狗 函數定義在Splc501sys.asm
FG_ClearScreen(0);
x++;
if(x==128) x=60;
FG_PutBitmap(&BIRD_Frame4,x,60);
for(j=0;j<=2;j++) //延時 保持整個顯示屏點亮
for(i=0;i<0xffff;i++)
Clear_Watch_Dog(); //清看門狗 函數定義在Splc501sys.asm
FG_ClearScreen(0);
FG_PutBitmap(&BIRD_Frame5,x,60);
for(j=0;j<=2;j++) //延時 保持整個顯示屏點亮
for(i=0;i<0xffff;i++)
Clear_Watch_Dog(); //清看門狗 函數定義在Splc501sys.asm
FG_ClearScreen(0);
x++;
if(x==128) x=60;
FG_PutBitmap(&BIRD_Frame6,x,60);
for(j=0;j<=2;j++) //延時 保持整個顯示屏點亮
for(i=0;i<0xffff;i++)
Clear_Watch_Dog(); //清看門狗 函數定義在Splc501sys.asm
FG_ClearScreen(0); //清屏 函數定義在Splc501sys.asm
goto loop;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -