📄 lcm.c.bak
字号:
if((tc_column==(8+(U8)gb_LCM_reverse*LCM_ReverseOffset))||(tc_column==(16+(U8)gb_LCM_reverse*LCM_ReverseOffset))) // No Media
{
LCM_ShowChar8x16(12,tc_column); // space
tc_column+=8;
}
}
LCM_ShowChar8x16((gw_FM_frequency%1000)/100,tc_column);
tc_column+=8;
LCM_ShowChar8x16((gw_FM_frequency%100)/10,tc_column);
tc_column+=8;
LCM_ShowChar8x16(65,tc_column);
tc_column+=2;
LCM_ShowChar8x16(gw_FM_frequency%10,tc_column);
tc_column+=8;
if((gc_CurrentCard==2)||(gc_CurrentCard==3)||(gc_CurrentCard==5)) // Media insert
{
if(gc_LCM_Size==0)
{
LCM_ShowChar8x16(12,tc_column); // space
}
}
if(gc_LCM_Size!=0)
{
LCM_ShowChar8x16(25,tc_column); // M
tc_column+=8;
LCM_ShowChar8x16(20,tc_column); // H
tc_column+=8;
LCM_ShowChar8x16(64,tc_column); // z
}
}
void LCM_ShowChar8x16(U8 Num,U8 tc_column)
{
U8 i,j;
for(i=0;i<2;i++)
{
LCM_Set_PageColumn(i+gc_LCM_line,tc_column);
for(j=0;j<8;j++)
{
LCM_Send_Data(CharIcon8x16[Num*16+j+i*8]);
}
}
}
void LCM_ShowChar8x16_L2(U8 Num,U8 tc_column)
{
U8 i,j,k;
if(gc_LCM_Size==2)
{
k=1;
}
else
{
k=0;
}
for(i=2;i<4;i++)
{
LCM_Set_PageColumn(i+k,tc_column);
for(j=0;j<8;j++)
{
LCM_Send_Data(CharIcon8x16[Num*16+j+(i-2)*8]);
}
}
}
void LCM_ShowPAUSE(void)
{
U8 i,j,k=0;
U8 tc_column;
tc_column=(U8)gc_LCM_Size*16+(U8)gb_LCM_reverse*LCM_ReverseOffset;
if(gc_LCM_Size==2)
{
tc_column=tc_column-16;
k=2;
}
LCM_ClearScreen();
for(j=0;j<4;j++)
{
LCM_Set_PageColumn(j+k,tc_column);
for(i=0;i<96;i++)
{
LCM_Send_Data(PAUSEIcon96x32[((U16)j*96)+i]);
}
}
}
void LCM_ShowPlayTime(U16 time)
{
U8 tc_column;
if(gc_LCM_Size==0)
{
tc_column=14+(U8)gb_LCM_reverse*LCM_ReverseOffset;
}
else
{
tc_column=93;
}
LCM_ShowChar8x16(time/600,tc_column);
tc_column+=8;
LCM_ShowChar8x16((time%600)/60,tc_column);
tc_column+=8;
LCM_ShowChar8x16(10,tc_column);
tc_column+=2;
LCM_ShowChar8x16((time%60)/10,tc_column);
tc_column+=8;
LCM_ShowChar8x16(time%10,tc_column);
}
void LCM_ShowVOL(void)
{
U8 tc_column;
U8 VOL;
if(gc_LCM_Size==0)
{
tc_column=12+(U8)gb_LCM_reverse*LCM_ReverseOffset;
}
else
{
tc_column=28;
}
LCM_ShowChar12x32(28,tc_column); // V
tc_column+=12;
LCM_ShowChar12x32(23,tc_column); // O
tc_column+=12;
LCM_ShowChar12x32(20,tc_column); // L
tc_column+=24;
VOL=gc_DSP_Volume/3;
LCM_ShowChar12x32(VOL/10,tc_column);
tc_column+=12;
LCM_ShowChar12x32(VOL%10,tc_column);
}
void LCM_ShowSongNumber(void) // 12x32
{
U8 tc_column;
if(gc_LCM_Size==0)
{
tc_column=12+(U8)gb_LCM_reverse*LCM_ReverseOffset;
}
else
{
tc_column=24;
}
LCM_ShowChar12x32(gw_FileIndex[0]/100,tc_column);
tc_column+=12;
LCM_ShowChar12x32((gw_FileIndex[0]%100)/10,tc_column);
tc_column+=12;
LCM_ShowChar12x32(gw_FileIndex[0]%10,tc_column);
tc_column+=12;
LCM_ShowChar12x32(10,tc_column); // "/"
tc_column+=12;
LCM_ShowChar12x32(gw_FileTotalNumber[0]/100,tc_column);
tc_column+=12;
LCM_ShowChar12x32((gw_FileTotalNumber[0]%100)/10,tc_column);
tc_column+=12;
LCM_ShowChar12x32(gw_FileTotalNumber[0]%10,tc_column);
}
void LCM_ShowChar12x32(U8 Num,U8 tc_column)
{
U8 i,j,k;
k=gc_LCM_Size&0x02;
for(i=0;i<4;i++)
{
LCM_Set_PageColumn(i+k,tc_column);
for(j=0;j<12;j++)
{
LCM_Send_Data(CharIcon12x32[Num*48+j+i*12]);
}
}
}
void LCM_ShowFrequency_L(void) // 12x32
{
U8 tc_column;
if(gc_LCM_Size==0)
{
tc_column=4+(U8)gb_LCM_reverse*LCM_ReverseOffset;
}
else
{
tc_column=16;
}
if(gw_FM_frequency>999)
{
LCM_ShowChar12x32(1,tc_column);
}
else
{
LCM_ShowChar12x32(31,tc_column);
}
tc_column+=12;
LCM_ShowChar12x32((gw_FM_frequency%1000)/100,tc_column);
tc_column+=12;
LCM_ShowChar12x32((gw_FM_frequency%100)/10,tc_column);
tc_column+=12;
LCM_ShowChar12x32(32,tc_column); // "."
tc_column+=8;
LCM_ShowChar12x32(gw_FM_frequency%10,tc_column);
tc_column+=12;
LCM_ShowChar12x32(21,tc_column); // M
tc_column+=12;
LCM_ShowChar12x32(17,tc_column); // H
tc_column+=12;
LCM_ShowChar12x32(30,tc_column); // z
}
void LCM_ShowPlayMode(void) // Big icon
{
U8 i,j,k=0;
U8 tc_column;
if(gc_LCM_Size==0)
{
tc_column=32+(U8)gb_LCM_reverse*LCM_ReverseOffset;
}
else if(gc_LCM_Size==1)
{
tc_column=48;
}
else
{
k=2;
tc_column=48;
}
for(i=0;i<4;i++)
{
LCM_Set_PageColumn(i+k,tc_column);
for(j=0;j<32;j++)
{
LCM_Send_Data(PlayModeIcon96x32[(gc_DisplayPlayMode-1)*128+j+i*32]);
}
}
}
void LCM_ShowPlayModeIcon(void) // Play mode small icon
{
U8 i,j,k;
if(gc_LCM_Size==1)
{
for(i=0;i<2;i++)
{
LCM_Set_PageColumn(i,76);
for(j=0;j<16;j++)
{
k=PlayModeIcon128x32[(gc_DisplayPlayMode-1)*32+j+i*16];
LCM_Send_Data(k);
}
}
}
if(gc_LCM_Size==2)
{
for(i=0;i<2;i++)
{
LCM_Set_PageColumn(i+6,34);
for(j=0;j<11;j++)
{
k=PlayModeIcon128x64[(gc_DisplayPlayMode-1)*22+j+i*11];
LCM_Send_Data(k);
}
}
}
}
void LCM_ShowEQ(void)
{
U8 tc_word,i;
U8 tc_column;
U8 tc_EQ_table[8];
switch(gc_PlayEQMode)
{
default:
gc_PlayEQMode=0;
case 0: // NORMAL
tc_word=6;
tc_EQ_table[0]=22;
tc_EQ_table[1]=23;
tc_EQ_table[2]=25;
tc_EQ_table[3]=21;
tc_EQ_table[4]=11;
tc_EQ_table[5]=20;
break;
case 1: // DBB
tc_word=3;
tc_EQ_table[0]=14;
tc_EQ_table[1]=12;
tc_EQ_table[2]=12;
break;
case 2: // JAZZ
tc_word=4;
tc_EQ_table[0]=19;
tc_EQ_table[1]=11;
tc_EQ_table[2]=29;
tc_EQ_table[3]=29;
break;
case 3: // DISCO
tc_word=4;
tc_EQ_table[0]=14;
tc_EQ_table[1]=18;
tc_EQ_table[2]=26;
tc_EQ_table[3]=13;
tc_EQ_table[4]=23;
break;
case 4: // POP
tc_word=3;
tc_EQ_table[0]=24;
tc_EQ_table[1]=23;
tc_EQ_table[2]=24;
break;
case 5: // CLASS
tc_word=5;
tc_EQ_table[0]=13;
tc_EQ_table[1]=20;
tc_EQ_table[2]=11;
tc_EQ_table[3]=26;
tc_EQ_table[4]=26;
break;
}
tc_column=(8-tc_word)*6;
if(gc_LCM_Size!=0)
{
tc_column+=16;
}
else
{
tc_column+=((U8)gb_LCM_reverse*LCM_ReverseOffset);
}
for(i=0;i<tc_word;i++)
{
LCM_ShowChar12x32(tc_EQ_table[i],tc_column);
tc_column+=12;
}
}
void LCM_Show_NOMP3FILE(void)
{
U8 i;
U8 tc_column=0;
U8 tc_NoFile[12];
if(gc_LCM_Size==1)
{
LCM_ShowChar8x16_L2(12,0);
LCM_ShowChar8x16_L2(12,8);
tc_column=16;
}
else if(gb_LCM_reverse==1)
{
tc_column=(U8)gb_LCM_reverse*LCM_ReverseOffset;
}
tc_NoFile[0]=26;
tc_NoFile[1]=27;
tc_NoFile[2]=12;
tc_NoFile[3]=25;
tc_NoFile[4]=28;
tc_NoFile[5]=03;
tc_NoFile[6]=12;
tc_NoFile[7]=18;
tc_NoFile[8]=21;
tc_NoFile[9]=24;
tc_NoFile[10]=17;
tc_NoFile[11]=67;
for(i=0;i<12;i++)
{
LCM_ShowChar8x16_L2(tc_NoFile[i],tc_column);
tc_column+=8;
}
if(gc_LCM_Size==1)
{
LCM_ShowChar8x16_L2(12,112);
LCM_ShowChar8x16_L2(12,120);
}
}
void LCM_Show_Filename(void)
{
U8 i;
U8 j;
U8 tc_column=(U8)gb_LCM_reverse*LCM_ReverseOffset;
U8 tc_DisplayWord;
U8 tc_data;
U16 tc_word;
if(gc_FileLongName[2]==0)
{
tc_word=(gc_FileLongName[4]-1)/2;
j=2;
}
else
{
tc_word=gc_FileLongName[4];
j=1;
}
if(gc_LCM_Size==0)
{
tc_DisplayWord=24;
}
else
{
tc_DisplayWord=32;
}
for(i=5+gc_DisplaySongnameCount*j;i<5+tc_DisplayWord+gc_DisplaySongnameCount*j;i+=j)
{
tc_data=gc_FileLongName[i]&0x7F;
if((gc_FileLongName[i]>='A') &&(gc_FileLongName[i]<='Z'))
{
tc_data=gc_FileLongName[i]-'A'+13;
}
else if((gc_FileLongName[i]>='a') &&(gc_FileLongName[i]<='z'))
{
tc_data=gc_FileLongName[i]-'a'+39;
}
else if((gc_FileLongName[i]>='0') &&(gc_FileLongName[i]<='9'))
{
tc_data=gc_FileLongName[i]-'0';
}
else if(gc_FileLongName[i]==':')
{
tc_data=10;
}
else if(gc_FileLongName[i]=='-')
{
tc_data=11;
}
else if(gc_FileLongName[i]=='.')
{
tc_data=65;
}
else if(gc_FileLongName[i]=='?')
{
tc_data=66;
}
else if(gc_FileLongName[i]=='!')
{
tc_data=67;
}
else if(gc_FileLongName[i]=='%')
{
tc_data=68;
}
else if(gc_FileLongName[i]==',')
{
tc_data=69;
}
else if(gc_FileLongName[i]==0x27)
{
tc_data=70;
}
else if(gc_FileLongName[i]==';')
{
tc_data=71;
}
else if(gc_FileLongName[i]=='"')
{
tc_data=72;
}
else if(gc_FileLongName[i]=='<')
{
tc_data=73;
}
else if(gc_FileLongName[i]=='>')
{
tc_data=74;
}
else if(gc_FileLongName[i]=='^')
{
tc_data=75;
}
else if(gc_FileLongName[i]=='~')
{
tc_data=77;
}
else
{
tc_data=12;
}
LCM_ShowChar8x16_L2(tc_data,tc_column);
tc_column+=8;
}
gc_DisplaySongnameCount++;
if(gc_LCM_Size==0)
{
if((gc_DisplaySongnameCount+11)>tc_word)
{
gc_DisplaySongnameCount=0;
}
}
else
{
if((gc_DisplaySongnameCount+15)>tc_word)
{
gc_DisplaySongnameCount=0;
}
}
}
void LCM_ShowERROR(void)
{
U8 tc_column;
if(gc_LCM_Size==0)
{
tc_column=18+(U8)gb_LCM_reverse*LCM_ReverseOffset;
}
else
{
tc_column=34;
}
LCM_ClearScreen();
LCM_ShowChar12x32(15,tc_column);
tc_column+=12;
LCM_ShowChar12x32(25,tc_column);
tc_column+=12;
LCM_ShowChar12x32(25,tc_column);
tc_column+=12;
LCM_ShowChar12x32(23,tc_column);
tc_column+=12;
LCM_ShowChar12x32(25,tc_column);
}
void LCM_ShowIRNum(void)
{
U8 i;
U8 tc_column;
U8 tc_ShowCount=4;
U8 tc_offset=0;
if(gb_ChannelSet==1) // Frequency
{
if(gc_LCM_Size==0)
{
tc_column=4+(U8)gb_LCM_reverse*LCM_ReverseOffset;
}
else
{
tc_column=16;
}
}
else // SONG
{
if(gc_LCM_Size!=0)
{
gb_LCM_reverse=0;
tc_offset=16;
}
tc_column=tc_offset+(U8)gb_LCM_reverse*LCM_ReverseOffset;
LCM_ShowChar12x32(26,tc_column); // S
LCM_ShowChar12x32(23,tc_column+12); // O
LCM_ShowChar12x32(22,tc_column+24); // N
LCM_ShowChar12x32(16,tc_column+36); // G
LCM_ShowChar12x32(31,tc_column+48); // space
tc_column+=60;
if(((gc_NUMBER[2]==2)||(gc_NUMBER[2]==1))&&((gc_NUMBER[1]==0xFF)||(gc_NUMBER[0]==0xFF)))
{
LCM_ShowChar12x32(gc_NUMBER[2],tc_column);
tc_column+=12;
if(gc_NUMBER[1]==0xFF)
{
LCM_ShowChar12x32(0,tc_column);
tc_column+=12;
if(gc_NUMBER[0]==0xFF)
{
LCM_ShowChar12x32(0,tc_column);
}
else
{
LCM_ShowChar12x32(gc_NUMBER[0],tc_column);
}
return;
}
else
{
LCM_ShowChar12x32(gc_NUMBER[1],tc_column);
tc_column+=12;
if(gc_NUMBER[0]==0xFF)
{
LCM_ShowChar12x32(0,tc_column);
}
else
{
LCM_ShowChar12x32(gc_NUMBER[0],tc_column);
}
}
return;
}
else
{
if(gc_NUMBER[2]!=0xFF)
{
LCM_ShowChar12x32(gc_NUMBER[2],tc_column);
tc_column+=12;
}
if(gc_NUMBER[1]!=0xFF)
{
LCM_ShowChar12x32(gc_NUMBER[1],tc_column);
tc_column+=12;
}
if(gc_NUMBER[0]!=0xFF)
{
LCM_ShowChar12x32(gc_NUMBER[0],tc_column);
}
}
return;
}
if(gc_NUMBER[3]!=0xFF)
{
LCM_ShowChar12x32(gc_NUMBER[3],tc_column);
tc_column+=12;
tc_ShowCount--;
}
if(gc_NUMBER[2]!=0xFF)
{
if((tc_ShowCount==4)&&(gc_NUMBER[2]!=1))
{
LCM_ShowChar12x32(31,tc_column); // space
tc_column+=12;
tc_ShowCount--;
}
LCM_ShowChar12x32(gc_NUMBER[2],tc_column);
tc_column+=12;
tc_ShowCount--;
}
if(gc_NUMBER[1]!=0xFF)
{
if((tc_ShowCount==4)&&(gc_NUMBER[1]!=1))
{
LCM_ShowChar12x32(31,tc_column); // space
tc_column+=12;
tc_ShowCount--;
}
LCM_ShowChar12x32(gc_NUMBER[1],tc_column);
tc_column+=12;
tc_ShowCount--;
}
if(gc_NUMBER[0]!=0xFF)
{
if((tc_ShowCount==4)&&(gc_NUMBER[0]!=1))
{
LCM_ShowChar12x32(31,tc_column); // space
tc_column+=12;
tc_ShowCount--;
}
if(tc_ShowCount==1) // Frequency
{
LCM_ShowChar12x32(32,tc_column); // .
tc_column+=8;
}
LCM_ShowChar12x32(gc_NUMBER[0],tc_column);
tc_column+=12;
tc_ShowCount--;
}
for(i=0;i<tc_ShowCount;i++)
{
if(i==(tc_ShowCount-1)) // Frequency
{
LCM_ShowChar12x32(32,tc_column); // .
tc_column+=8;
}
LCM_ShowChar12x32(31,tc_column);
tc_column+=12;
}
LCM_ShowChar12x32(21,tc_column); // M
tc_column+=12;
LCM_ShowChar12x32(17,tc_column); // H
tc_column+=12;
LCM_ShowChar12x32(30,tc_column); // z
}
void LCM_ShowMediaType(void)
{
U8 i,j,k=0;
if(gb_Media_type==1)
{
k=50;
}
for(i=6;i<8;i++)
{
LCM_Set_PageColumn(i,0);
for(j=0;j<25;j++)
{
LCM_Send_Data(MediaTypeIcon25x16[k]);
k++;
}
}
}
void LCM_ShowEQIcon(void)
{
U8 i,j,k;
k=gc_PlayEQMode*30;
for(i=0;i<2;i++)
{
LCM_Set_PageColumn(i+6,54);
for(j=0;j<15;j++)
{
LCM_Send_Data(EQIcon128x64[k]);
k++;
}
}
}
void LCM_ShowBitRate(void)
{
gc_LCM_line=6;
LCM_ShowChar8x16(gw_DisplayBitRate/100,78);
LCM_ShowChar8x16(gw_DisplayBitRate%100/10,86);
LCM_ShowChar8x16(gw_DisplayBitRate%10,94);
gc_LCM_line=0;
}
void LCM_ShowBitRateIcon(void)
{
U8 i,j,k=0;
for(i=6;i<8;i++)
{
LCM_Set_PageColumn(i,104);
for(j=0;j<21;j++)
{
LCM_Send_Data(BitRateIcon128x64[k]);
k++;
}
}
}
void P_LCM_Write_CMD(U8 CMD)
{
XBYTE[0xB402]&=0xEF; // A0=0 : FM[12]=0
XBYTE[0xB402]&=0xBF; // CS=0 : FM[14]=0
XBYTE[0xB030]=CMD;
if((CMD&0x80)==0x80)
{
P_LCM_D7=1;
}
else
{
P_LCM_D7=0;
}
XBYTE[0xB402]&=0xDF; // WR=0 : FM[13]=0
XBYTE[0xB402]|=0x20; // WR=1 : FM[13]=1
XBYTE[0xB402]|=0x40; // CS=1 : FM[14]=1
XBYTE[0xB402]|=0x10; // A0=1 : FM[12]=1
}
void P_LCM_Write_DAT(U8 DAT)
{
XBYTE[0xB402]&=0xBF; // CS=0 : FM[14]=0
XBYTE[0xB030]=DAT;
if((DAT&0x80)==1)
{
P_LCM_D7=1;
}
else
{
P_LCM_D7=0;
}
XBYTE[0xB402]&=0xDF; // WR=0 : FM[13]=0
XBYTE[0xB402]|=0x20; // WR=1 : FM[13]=1
XBYTE[0xB402]|=0x40; // CS=1 : FM[14]=1
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -