我的空间有程序,你去看看,有十几种移动方法
屏幕点阵数的话也可以随时改动的
/*************呈现各种显示效果的函数集****************/
void flash_bai(uchar *flash_word,uchar flash_heard,uchar number,uchar sdu,uchar state)
{register uchar i,j,l;
for(i=0;i
for(j=0;j<16;j++)
{
for(l=0;l<8;l++)
{
if(j<8)
{
dispram[l*4+1]=dispram[l*4+1]&0xff<
dispram[l*4+2]=dispram[l*4+2]&0xff>>j|(flash_word[(flash_heard+i)*32+l*4+3]<<(7-j)&0x10);
}
else
{
dispram[l*4] =dispram[l*4]&0xff<<(j-7)|flash_word[(flash_heard+i)*32+l*4]>>(15-j);
dispram[l*4+1]=flash_word[(flash_heard+i)*32+l*4]<<(j-7)|(flash_word[(flash_heard+i)*32+l*4+1]>>(15-j));
dispram[l*4+2]=flash_word[(flash_heard+i)*32+l*4+2]<<(15-j)|(flash_word[(flash_heard+i)*32+l*4+3]>>(j-7));
dispram[l*4+3]=(dispram[l*4+3]&0xff>>(j-7))|flash_word[(flash_heard+i)*32+l*4+3]<<(15-j);
}
}
delay(sdu*SPEED);
}
delay(state*SPEED);
}
}
/*******************霓虹灯效果************************/
void flash(uchar *flash_word,uchar flash_heard,uchar number,uchar sdu,uchar state)
{register uchar i,j,k,l;
for(i=0;i
for(j=0;j<=16;j++)
{
for(k=17;k>j;k--)
{
for(l=0;l<16;l++)
{
if(j>8)
{
dispram[l*2] =1<<(8-k+j)|(flash_word[(flash_heard+i)*32+l*2]&0xff>>(16-j));
dispram[l*2+1]=flash_word[(flash_heard+i)*32+l*2+1];
}
else
{
dispram[l*2]=1<<(8-k+j);
dispram[l*2+1]=1<<(16-k+j)|(flash_word[(flash_heard+i)*32+l*2+1]&0xff>>(8-j));
}
}
delay(sdu*SPEED);
}
for(k=17;k>j;k--)
{
for(l=0;l<16;l++)
{
if(j>8)
{
dispram[l*2]=1<<(k-8)|(flash_word[(flash_heard+i)*32+l*2]&0xff>>(16-j));
}
else
{
dispram[l*2]=1<<(k-8);
dispram[l*2+1]=1<
}
}
delay(sdu*SPEED);
}
}
delay(state*SPEED);
}
}
/*******************跳动的米奇*********************/
void miqi_jump(void)
{register uchar jump_i;
while((receive[1]&0x0f)<2)//
{
switch (timer/3650)
{
case 0:for(jump_i=0;jump_i<16;jump_i++)
{
dispram[jump_i*2] = word1[11][jump_i*2]<<1|word1[11][jump_i*2+1]>>7;
dispram[jump_i*2+1] = word1[11][jump_i*2+1]<<1;//左移
}break;
case 1:for(jump_i=0;jump_i<15;jump_i++)
{
dispram[jump_i*2+2] = word1[11][jump_i*2];
dispram[jump_i*2+3] = word1[11][jump_i*2+1];
}
dispram[0] = 0;
dispram[1] = 0;
break;//下移
case 2:for(jump_i=0;jump_i<16;jump_i++)
{
dispram[jump_i*2+1] = word1[11][jump_i*2+1]>>1|word1[11][jump_i*2]<<7;
dispram[jump_i*2] = word1[11][jump_i*2]>>1;
}break;//右移
case 3:for(jump_i=0;jump_i<15;jump_i++)
{
dispram[jump_i*2] = word1[11][jump_i*2+2];
dispram[jump_i*2+1] = word1[11][jump_i*2+3];
}
dispram[30] = 0;
dispram[31] = 0;
break;//上移
case 4: for(jump_i=0;jump_i<15;jump_i++)
{
dispram[jump_i*2+2] = word1[11][jump_i*2]<<1|word1[11][jump_i*2+1]>>7;
dispram[jump_i*2+3] = word1[11][jump_i*2+1]<<1;//左移
}
dispram[0] = 0;
dispram[1] = 0;
break;//下移
case 5: for(jump_i=0;jump_i<16;jump_i++)
{
dispram[jump_i*2+1] = word1[11][jump_i*2+3]>>1|word1[11][jump_i*2+2]<<7;
dispram[jump_i*2] = word1[11][jump_i*2+2]>>1;
}dispram[30] = 0;
dispram[31] = 0;
break;//上移
case 6: for(jump_i=0;jump_i<15;jump_i++)
{
dispram[jump_i*2+3] = word1[11][jump_i*2+1]>>1|word1[11][jump_i*2]<<7;
dispram[jump_i*2+2] = word1[11][jump_i*2]>>1;
}
dispram[0] = 0;
dispram[1] = 0;
break;
case 7: for(jump_i=0;jump_i<16;jump_i++)
{
dispram[jump_i*2] = word1[11][jump_i*2+2]<<1|word1[11][jump_i*2+3]>>7;
dispram[jump_i*2+1] = word1[11][jump_i*2+3]<<1;//左移
}
dispram[30] = 0;
dispram[31] = 0;
break;
default:for(jump_i=0;jump_i<32;jump_i++)
dispram[jump_i] = word1[11][jump_i];
}
}
}
/********从wordsp的第OpenDheard个字开始开门效果显示number个字**********/
//用数组更加节省空间
void Open_door(uchar wordsp[][32],uchar OpenDheard,uchar number,uchar sdu,uchar state)
{register uchar i,j,k;
for(k=0;k
for(j=1;j<9;j++)
{
for(i=0;i<16;i++)
{
dispram[i*2]=dispram[i*2]&0xff<
dispram[i*2+1]=dispram[i*2+1]&0xff>>j|wordsp[OpenDheard+k][1+2*i]&0xff<<(8-j);
}
delay(sdu*SPEED);
}
delay(state*TIME);
}
}
/********从wordsp的第CloseDheard个字开始关门效果显示number个字**********/
//用数组更加节省空间
void Close_door(uchar wordsp[][32],uchar CloseDheard,uchar number,uchar sdu,uchar state)
{register uchar i,j,k;
for(k=0;k
for(j=1;j<9;j++)
{
for(i=0;i<16;i++)
{
dispram[i*2]=dispram[i*2]&0xff>>j|wordsp[CloseDheard+k][2*i]&0xff<<(8-j);
dispram[i*2+1]=dispram[i*2+1]&0xff<
}
delay(sdu*SPEED);
}
delay(state*TIME);
}
}
/********从wordsp的第Far_Awayheard个字开始两边拉开显示number个字**********/
//用数组更加节省空间
void Far_Away(uchar wordsp[][32],uchar Far_Awayheard,uchar number,uchar sdu,uchar state)
{register uchar i,j,k;
for(k=0;k
for(j=1;j<9;j++)
{
for(i=0;i<16;i++)
{
dispram[i*2]=dispram[i*2]<
dispram[i*2+1]=dispram[i*2+1]>>j|wordsp[Far_Awayheard+k][1+2*i]&0xff<<(8-j);
}
delay(sdu*SPEED);
}
delay(state*TIME);
}
}
/********从wordsp的第Close_Toheard个字开始两边合拢显示number个字**********/
//用数组更加节省空间
void Close_To(uchar wordsp[][32],uchar Close_Toheard,uchar number,uchar sdu,uchar state)
{register uchar i,j,k;
for(k=0;k
for(j=1;j<9;j++)
{
for(i=0;i<16;i++)
{
dispram[i*2]=dispram[i*2]&0xff>>j|wordsp[Close_Toheard+k][2*i]<<(8-j);
dispram[i*2+1]=dispram[i*2+1]&0xff<
}
delay(sdu*SPEED);
}
delay(state*TIME);
}
}
/****************卷帘出显示number个字***************/
//用指针更加节省空间
void M_Words(uchar *wordsp,uchar MWheard,uchar number,uchar sdu,uchar state)
{register uchar i,j;
for(j=0;j
for(i=0;i<32;i++)
{
dispram[i]=wordsp[(MWheard+j)*32+i];
if(i%2)
delay(sdu*SPEED);
}
delay(state*TIME);
}
}
/************从UP_Pullp的第UP_Pullheard个字向上拉出number个字***************/
//用数组更加节约空间
void UP_Pull_Word(uchar UP_Pullp[][32],uchar UP_Pullheard,uchar number,uchar sdu,uchar state)
{register uchar i,j,k;
for(i=0;i
for(j=0;j<16;j++)
{
for(k=0;k<15-j;k++)
{
dispram[k*2]=dispram[(k+1)*2];
dispram[k*2+1]=dispram[(k+1)*2+1];
}
dispram[30-2*j]=UP_Pullp[UP_Pullheard+i][(15-j)*2];
dispram[31-2*j]=UP_Pullp[UP_Pullheard+i][(15-j)*2+1];
delay(sdu*SPEED);
}
delay(state*TIME);
}
}
/*********从UPp的第UPheard个字向上滚屏number个字***************/
//用数组更加节约空间
void UP_Run_Word(uchar UPp[][32],uchar UPheard,uchar number,uchar sdu,uchar state)
{register uchar i,j,k;
for(i=0;i
for(j=0;j<16;j++)
{
for(k=0;k<15;k++)
{
dispram[k*2]=dispram[(k+1)*2];
dispram[k*2+1]=dispram[(k+1)*2+1];
}
dispram[30]=UPp[UPheard+i][j*2];
dispram[31]=UPp[UPheard+i][j*2+1];
delay(sdu*SPEED);
}
delay(state*TIME);
}
}
/*********从Down_Pullp的第Down_Pullheard个字向下拉出number个字***************/
//用数组更加节约空间
void Down_Pull_Word(uchar Down_Pullp[][32],uchar Down_Pullheard,uchar number,uchar sdu,uchar state)
{register uchar i,j,k;
for(i=0;i
for(j=0;j<16;j++)
{
for(k=15;k>j;k--)
{
dispram[k*2]=dispram[(k-1)*2];
dispram[k*2+1]=dispram[(k-1)*2+1];
}
dispram[2*j]=Down_Pullp[Down_Pullheard+i][2*j];
dispram[2*j+1]=Down_Pullp[Down_Pullheard+i][2*j+1];
delay(sdu*SPEED);
}
delay(state*TIME);
}
}
/*********从Downp的第UPheard个字向下滚屏number个字***************/
//用指针更加节约空间
void Down_Run_Word(uchar *Downp,uchar UPheard,uchar number,uchar sdu,uchar state)
{register uchar i,j,k;
for(i=0;i
for(j=0;j<16;j++)
{
for(k=15;k>0;k--)
{
dispram[k*2]=dispram[(k-1)*2];
dispram[k*2+1]=dispram[(k-1)*2+1];
}
dispram[0]=Downp[(UPheard+i)*32+(15-j)*2];
dispram[1]=Downp[(UPheard+i)*32+(15-j)*2+1];
delay(sdu*SPEED);
}
delay(state*TIME);
}
}
/**********从LRp的第LRheard个字左移出显示number个字************/
//用指针更加节约空间
void L_Removeout_Word(uchar *LRp,uchar LRheard,uchar number,uchar sdu,uchar state)
{register uchar i,j,k,l;
for(i=0;i
for(j=0;j<2;j++)
for(k=0;k<8;k++)
{
for(l=0;l<16;l++)
{
dispram[l*2]=dispram[l*2]<<1|dispram[l*2+1]>>7;
dispram[l*2+1]=dispram[l*2+1]<<1|LRp[(i+LRheard)*32+l*2+j]>>(7-k);
}
delay(sdu*SPEED);
}
delay(state*TIME);
}
}
/**********从L_Pullp的第L_Pullheard个字左拉出显示number个字************/
//用指针更加节约空间
void L_Pull_Word(uchar *L_Pullp,uchar L_Pullheard,uchar number,uchar sdu,uchar state)
{register uchar i,j,k,l;
for(i=0;i
for(j=0;j<2;j++)
for(k=0;k<8;k++)
{
for(l=0;l<16;l++)
{
if(j==0)
{
dispram[l*2]=dispram[l*2]<<1|dispram[l*2+1]>>7;
dispram[l*2+1]=(dispram[l*2+1]&0xff<<(k+1))<<1|L_Pullp[(i+L_Pullheard)*32+l*2+1]&0xff>>(7-k);
}
else
{
dispram[l*2]=(dispram[l*2]&0xff<<(k+1))<<1|L_Pullp[(i+L_Pullheard)*32+l*2]&0xff>>(7-k);
dispram[l*2+1]=L_Pullp[(i+L_Pullheard)*32+l*2+1];
}
}
delay(sdu*SPEED);
}
delay(state*TIME);
}
}
/****************卷帘出黑屏***************/
void M_Black(void)
{register uchar i;
for(i=0;i<32;i++)
{
dispram[i]=0x00;
if(i%2)
delay(5*SPEED);
}
}
/**********从RRp的第RRheard个字右移出显示number个字************/
//用指针更加节约空间
void R_Removeout_Word(uchar *RRp,uchar RRheard,uchar number,uchar sdu,uchar state)
{register uchar i,j,k,l;
for(i=0;i
for(j=2;j>0;j--)
for(k=0;k<8;k++)
{
for(l=0;l<16;l++)
{
dispram[l*2+1]=dispram[l*2+1]>>1|dispram[l*2]<<7;
dispram[l*2]=dispram[l*2]>>1|RRp[(i+RRheard)*32+l*2+j-1]<<(7-k);
}
delay(sdu*SPEED);
}
delay(state*TIME);
}
}
要的话给个地址