📄 yibiao.bak
字号:
if (key=='l')
goto j2;
if (key=='k')
break;
xs_time();
}
clear();
xs_hhz(0,0,QSRYGMM);
if (klx==1)
{
flash[0]=ygmm[0];
flash[1]=ygmm[1];
ygmm[0]=use_001b_file[2];
ygmm[1]=use_001b_file[3];
//ygmm[0]=sbmm[0];
// ygmm[1]=sbmm[1];
i=password(0);
ygmm[0]=flash[0];
ygmm[1]=flash[1];
}
else
{
i=password(0);
}
if (i==2)/*返回退卡*/
{
ck_flag=0;
out_card();
// ygmm[0]=flash[0];
// ygmm[1]=flash[1];
goto j3;
}
if (i==1) /*密码正确*/
{
ck_flag=0;
out_card();
XBR=1;
yjsb=0;
/*生成下班交易记录*/
dey=6;
if (NET==1)
dey=dey|0x40;
trade_record(dey);
/*生成下班交易记录*/
dey=send_jl(0,0xb5);
flash[17]='x';
we_main(flash,100,1040,0);
goto start;
}
if (i==0)/*密码错误*/
{
ck_flag=0;
out_card();
goto j3;
}
}
if (key=='.')
{
while(1)
{
xs_time();
key=getkey();
if (key!=0xff)
if (key=='k')
{
if (klx==1)
goto j5;
if (klx==2)
goto j9;
card_err_state=read_use_001b_file();/*读'27'文件*/
if (card_err_state!=0)
{
kybc();
goto j3;
}
if (yx!=ichy)
{
clear();
xs_hhz(0,16,FSBYGK);
an_key_back();
goto j9;
}
goto j5;
}
else
goto j2;
}
}
xs_time();
}
}
/*主程序结束*/
void write_control(unsigned char con)
{
RW=0;
RS=0;
E=con;
}
void write_data(unsigned char d)
{
RW=0;
RS=1;
E=d;
}
void init_xs()
{
unsigned char page;
de30ms();
de30ms();
de30ms();
de30ms();
de30ms();
de30ms();
xscs1();
write_control(0x3f);
write_control(0xc0);
xscs2();
write_control(0x3f);
write_control(0xc0);
for(page=0;page<8;page++)
{
clr_hang(page);
}
}
void clear()
{
unsigned char page;
for(page=0;page<6;page++)
{
clr_hang(page);
}
}
unsigned char getkey()
{
unsigned char temp,i=0;
static bit keyf=1;
key_dlu();
key_dlu();
//ES=0;
for(i=0;i<21;i++)
{
if (i==0)
KEY_SDA=0;
else
KEY_SDA=1;
KEY_CLK=1;
dlu();
KEY_CLK=0;
dlu();
temp=XBYTE[0xc010];
temp=temp&0x01;
if (temp==0)
{
// comm_status=0;
// ES=1;
if (keyf==1)
switch (i)
{
case 1:{keyf=0;sound();return 8;}
case 2:{keyf=0;sound();return 7;}
case 3:{keyf=0;sound();return 6;}
case 4:{keyf=0;sound();return 5;}
case 5:{keyf=0;sound();return 4;}
case 6:{keyf=0;sound();return 3;}
case 7:{keyf=0;sound();return 2;}
case 8:{keyf=0;sound();return 1;}
case 9:{keyf=0;sound();return 'k';}
case 10:{keyf=0;sound();return 'l';}
case 11:{keyf=0;sound();return '.';}
case 12:{keyf=0;sound();return 0;}
case 13:{keyf=0;sound();return 'j';}
case 14:{keyf=0;sound();return 'g';}
case 15:{keyf=0;sound();return 'e';}
case 16:{keyf=0;sound();return 9;}
case 17:{keyf=0;sound();return 't';}
case 18:{keyf=0;sound();return 'x';}
case 19:{keyf=0;sound();return 's';}
}
else
return 0xff;
}
}
keyf=1;
//comm_status=0;
//ES=1;
return 0xff;
}
void clr_hang(unsigned char hang)
{
unsigned char lie;
xscs1();
write_control(0xb8+hang);
for(lie=0;lie<64;lie++)
{
write_control(0x40+lie);
write_data(0);
}
xscs2();
write_control(0xb8+hang);
for(lie=0;lie<64;lie++)
{
write_control(0x40+lie);
write_data(0);
}
}
void xs_zi(unsigned char hh,unsigned char ll,unsigned int p)
{
unsigned char idata i;
unsigned char idata buf;
unsigned int idata temp;
unsigned char idata disp_suf[32];
temp=dw_zk(p);
for(i=0;i<32;i++)
{
ZK_CS=0;
zk_save=0;
// dlu();
buf=XBYTE[temp+i];
//dlu();
ZK_CS=1;
zk_save=1;
disp_suf[i]=buf;
dlu();
}
ZK_CS=1;
dlu();
dlu();
dlu();
xscs1();
for(i=0;i<16;i++)
{
if ((ll+i)>63)
{
xscs2();
write_control(0xb8+hh);
write_control(0x40+ll+i-64);
}
else
{
xscs1();
write_control(0xb8+hh);
write_control(0x40+ll+i);
}
write_data(disp_suf[i]);
//p++;
}
for(i=0;i<16;i++)
{
if ((ll+i)>63)
{
xscs2();
write_control(0xb8+hh+1);
write_control(0x40+ll+i-64);
}
else
{
xscs1();
write_control(0xb8+hh+1);
write_control(0x40+ll+i);
}
write_data(disp_suf[i+16]);
// p++;
}
}
void xscs1()
{
CS1=1;
CS2=0;
}
void xscs2()
{
CS1=0;
CS2=1;
}
void xs_hhz(unsigned char hh,unsigned char ll, unsigned int *p)
{
unsigned char i;
for(i=0;*(p+i)!=0;i++)
if (*(p+i)!=0xffff)
xs_zi(hh,ll+i*16,*(p+i));
}
void astobcd(unsigned char n)
{
char l,temp;
if (n==1) return;
for(l=keybuf_p;l<6;l++)
keybuf[l]=0x00;
for(l=0;l<n;l+=2)
{
temp=keybuf[l]<<4;
temp=temp|keybuf[l+1];
keybuf[l/2]=temp;
}
}
bit strcomp(unsigned char *p1,unsigned char *p2,unsigned char num)
{
unsigned char i;
for(i=0;i<num;i++)
{
if ((*(p1+i))!=(*(p2+i)))
return 0;
}
return 1;
}
void jezh1(bit fj)
{
union{
unsigned long da;
unsigned char aa[4];
}idata jes;
unsigned long xdata temp;
unsigned char xdata i=0,g=0;
jes.aa[0]=balance[0];
jes.aa[1]=balance[1];
jes.aa[2]=balance[2];
jes.aa[3]=balance[3];
if (fj==0)
{
huakuang(4,7,0);
}
if (fj==1)
{
jes.da=jes.da-shue.acclong;
}
dog();
main_comm();
temp=jes.da/1000000000;
if (temp!=0)
{
if (fj==1)
{
if (xsje[0]!=temp)
{
xs_shu(4,3*8,yi_1+(temp*8));
xsje[0]=temp;
}
}
else
{
xs_shu(4,3*8,yi_1+(temp*8));
}
i++;
}
jes.da=jes.da-temp*1000000000;
temp=jes.da/100000000;
if ((temp!=0)||(i!=0))
{
if (fj==1)
{
if (xsje[1]!=temp)
{
xs_shu(4,4*8,yi_1+(temp*8));
xsje[1]=temp;
}
}
else
{
xs_shu(4,4*8,yi_1+(temp*8));
}
i++;
}
main_comm();
jes.da=jes.da-temp*100000000;
temp=jes.da/10000000;
if ((temp!=0)||(i!=0))
{
if (fj==1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -