📄 51型万能遥控器.txt
字号:
x=65535-width-ERR1+ERR2;
x1=x/256;
x2=x%256;
x=65535-width-ERR1;
x3=x/256;
x4=x%256;
}
else
{
x=65535-width-ERR1;
x1=x/256;
x2=x%256;
x=65535-width*3-ERR1+ERR2;
x3=x/256;
x4=x%256;
x=65535-width*7-ERR1+ERR2;
x5=x/256;
x6=x%256;
}
offset=CODESITE+(MAXBYTE+2)*(key+MAXKEY*device);
codelong=read(offset);
if(codelong>MAXBYTE*8) longflag=1;
else longflag=0;
gaplocate=read(offset+1)-1;
if(sharp_jvc==255)//255=rec
{
for(i=0;i<REC_LONG;I++)
cod=read(REC_AREA+key*REC_LONG+i);
}
else
{
for(i=0;i<(codelong+7)/8;i++)
cod=read(offset+2+i);
}
if(sharp_jvc==3)
{
if((flag%2)==1)
cod[0]=(cod[0]|0x10)&0xf7;
else
cod[0]=(cod[0]&0xef)|0x08;
flag++;
}
}
void send2()
{
unsigned char i,j,zero;
if(startH!=0)
{
TL0=0;
TH0=256-startL;
f38();
TL0=0;
TH0=256-startH;
ok=0;
while(ok==0);
}
i=0;
zero=0;
do
{
for(j=0;j<8;j++)
{
if((cod[i/8]&mask[j])!=0)// ==1
{
TR0=0;
TH0=x1;
TL0=x2;
TR0=1;
ok=0;
zero=0;
while(ok==0);
}
else
{
if(zero==0)
{
TR0=0;
TH0=x3;
TL0=x4;
TR0=1;
}
else
{
TR0=0;
TH0=x1;
TL0=x2;
TR0=1;
}
zero=1;
f38();
}
if(i==gaplocate)
{
if(gap!=0)
{
TR0=0;
x=65535-gap*256;
TH0=x/256;
TL0=x%256;
TR0=1;
ok=0;
while(ok==0);
}
}
i++;
if(i>=codelong) goto end;
}
}while(1);
end:EX0=0;
}
void encode_sharp(unsigned char key)
{
unsigned char i,m,k,width1,H1;
for(i=0;i=0;
width=read(0+device*PAGESIZE)*256+read(1+device*PAGESIZE);
stoptime=read(6+device*PAGESIZE);//yes
width1=width/FRR;
i=0;
N=0;
word=0;
count=0;
gap=0;
k=0;
EX0=1;
do{
readT=0;
time=0;
TL1=0;
TH1=255-stoptime;
while(readT==0);//start
}while(time==0);// stoptime start condition
i++;
count++;
c1:
readT=0;
while(readT==0);
H1=Hh*ERR+Hl/FRR;
if(Hh>36)
{
k++;
if(k==2) goto end1;
gaplocate=count;//gap locate
gap=Hh;
i++;
i=set(i);
}
else
{
m=(H1+width1/2)/width1;
if(m>3)
{
word=word|mask;
i++;
i=set(i);
}
else
{
i++;
i=set(i);
}
}
goto c1;
end1:
EX0=1;
if(i!=0)
{
cod[N]=word;
N++;
}
write_code(key);
}
void send_sharp()
{
unsigned char i,j;
i=0;
do
{
for(j=0;j<8;j++)
{
if((cod[i/8]&mask[j])!=0)// ==1
{
TR0=0;
TH0=x5;
TL0=x6;
TR0=1;
ok=0;
while(ok==0);
TR0=0;
TH0=x1;
TL0=x2;
TR0=1;
f38();
}
else
{
TR0=0;
TH0=x3;
TL0=x4;
TR0=1;
ok=0;
while(ok==0);
TR0=0;
TH0=x1;
TL0=x2;
TR0=1;
f38();
}
if(i==gaplocate)
{
if(gap!=0)
{
TR0=0;
x=65535-gap*256;
TH0=x/256;
TL0=x%256;
TR0=1;
ok=0;
while(ok==0);
}
}
i++;
if(i>=codelong) goto end;
}
}while(1);
end:EX0=0;
}
void encode2(unsigned char key)
{
unsigned char i,m,k,nT,width1,H1,L1,minL;
for(i=0;i=0;
width=read(0+device*PAGESIZE)*256+read(1+device*PAGESIZE);
stoptime=read(6+device*PAGESIZE);//yes
startL=read(3+device*PAGESIZE);
minL=read(5+device*PAGESIZE);
width1=width/FRR;
i=0;
N=0;
word=0;
count=0;
gap=0;
EX0=1;
do{
readT=0;
time=0;
TL1=0;
TH1=255-stoptime;
while(readT==0);//start
}while(time==0);// stoptime start condition
if(startL==0)
{
L1=Lh*ERR+Ll/FRR;
}
else
{
readT=0;
while(readT==0);
L1=Lh*ERR+Ll/FRR;
}
m=(L1+minL/2)/minL;//L1+width1/2<255
if(m==0) m=1;
for(m;m>0;m--)
{
i++;
count++;
}
c1:
readT=0;
time=0;
TL1=0;
TH1=255-stoptime;
do{
if((time==1)||(count>=MAXLONG)) goto end1;//>50msTV only have 80ms
}while(readT==0);
H1=Hh*ERR+Hl/FRR;
L1=Lh*ERR+Ll/FRR;
if(Hh>=13)//>4ms
{
gaplocate=count;//gap locate
gap=Hh;
if(Lh>15)
{
x=Lh*ERR+Ll/FRR;
m=x/width1;
}
else
m=(L1+minL/2)/minL;//L1+width1/2<255
if(m==0) m=1;
for(m;m>0;m--)
{
i++;
i=set(i);
}
}
else
{
nT=(H1+L1+width1/2)/width1;
if(nT==7) nT=8;
m=(L1+minL/2)/minL;//L1+width1/2<255
if(m==0) m=1;
k=nT-m;
for(k;k>0;k--)
{
word=word|mask;
i++;
i=set(i);
}
for(m;m>0;m--)
{
i++;
i=set(i);
}
}
goto c1;
end1:
EX0=0;
if(i!=0)
{
cod[N]=word;
N++;
}
i=cod[0]&0xf8;
if((width>730)&&(width<830)&&((i==72)||(i==80)))
write(7+device*PAGESIZE,3);
write_code(key);
}
void rec(unsigned char key)
{
unsigned char Hn,Ln,width1,minL,H1,L1;
for(Hn=0;Hn
width=read(0+device*PAGESIZE)*256+read(1+device*PAGESIZE);
minL=read(5+device*PAGESIZE);
width1=width/REC_ERR;
EX0=1;
readT=0;
while(readT==0);
time=0;
N=0;
Hh=12;
goto first;
c1:
readT=0;
time=0;
TH1=0;
N++;
do{
if(N>=REC_LONG) goto end1;
}while(readT==0);
first:H1=Hh*FRR+Hl/ERR;
L1=Lh*FRR+Ll/ERR;
Hn=(H1+L1+width1/2)/width1;
Ln=(L1+minL/2)/minL;//L1+width1/2<255
Hn=Hn-Ln;
if(time>=1)
{
if(Lh>12)
{
cod[N]=0xf8;
N++;
cod[N]=Lh;
}
else
cod[N]=0xf8|Ln;
}
else if(Hh>12)//4ms
{
if(Lh>12)
{
cod[N]=0;
N++;
cod[N]=Hh+Hl/128;
N++;
cod[N]=Lh;
}
else
{
cod[N]=Ln;
N++;
cod[N]=Hh+Hl/128;
}
}
else if(Lh>12)
{
cod[N]=(H1+width1/2)/width1*8;
N++;
cod[N]=Lh;
}
else
cod[N]=Hn*8+Ln;
goto c1;
end1:
EX0=0;
for(Hn=0;Hn<REC_LONG;HN++)
write(REC_AREA+key*REC_LONG+Hn,cod[Hn]);
}
void send_rec()
{
unsigned char i;
EX0=0;
N=0;
do
{
if((cod[N]&0xf8)==0xf8)
{
TR0=0;
TH0=5;
TR0=1;
ok=0;
while(ok==0);
if((cod[N]&0x07)==0)
{
N++;
TR0=0;
TH0=256-cod[N];
TL0=0;
TR0=1;
f38();
}
else
{
x=65536-(cod[N]&0x07)*width;
TR0=0;
TH0=x/256;
TL0=x%256;
TR0=1;
f38();
}
}
else if(cod[N]==0)
{
N++;
TR0=0;
TH0=256-cod[N];
TL0=0;
TR0=1;
ok=0;
while(ok==0);
N++;
TR0=0;
TH0=256-cod[N];
TL0=0;
TR0=1;
f38();
}
else if((cod[N]&0xf8)==0)
{
N++;
TR0=0;
TH0=256-cod[N];
TL0=REC_ERR2;
TR0=1;
ok=0;
while(ok==0);
x=65536-(cod[N-1]&0x07)*width;
TR0=0;
TH0=x/256;
TL0=x%256;
TR0=1;
f38();
}
else if((cod[N]&0x07)==0)
{
for(i=0;i<COD[N];I++)
{
TR0=0;
TH0=x1;
TL0=x2;
TR0=1;
ok=0;
while(ok==0);
}
N++;
TR0=0;
TH0=256-cod[N];
TL0=0;
TR0=1;
f38();
}
else
{
for(i=0;i
{
TR0=0;
TH0=x1;
TL0=x2;
TR0=1;
ok=0;
while(ok==0);
}
for(i=0;i<(cod[N]&0x07);i++)
{
TR0=0;
TH0=x3;
TL0=x4;
TR0=1;
f38();
}
}
N++;
if(N>=REC_LONG) goto end;
}while(1);
end:EX0=0;
}
void para()
{
unsigned char twogap[2],i,sum;
unsigned int w,temp,H,L,minL,minT,maxH;
EX0=1;
minT=60000;
minL=60000;
maxH=0;
startH=0;
startL=0;
sharp_jvc=0;
readT=0;
while(readT==0);
if(Lh>=11)// >3ms!!!!
{
startL=Lh+Ll/128;
readT=0;
while(readT==0);
startH=Hh+Hl/128;
}
L=Lh*256+Ll;
temp=L;
count=0;
c:
readT=0;
TL1=128;
TH1=255-13;//3.5ms-4.0ms
time=0;
do{
if(time==1) goto end;//3.75ms finish
}while(readT==0);
count++;
H=Hh*256+Hl;
L=Lh*256+Ll;
if((minL>L)&&(L>120)) minL=L;
if(maxH
w=H+L;
if(minT>w) minT=w;
w=H+temp;
if(minT>w) minT=w;
temp=L;
goto c;
end:
width=minT/2;
i=0;
while(1)
{
TL1=0;
TH1=256-CLOCK;//3ms
time=0;
readT=0;
do{
if(i==2) goto end2;
}while(readT==0);
x=Hh*256+Hl;
if(((x/width)>GAPTIMES)||(time>=MINGAP))// time>3*3ms
{
if(time>=MINGAP)
twogap=250;
else
twogap=Hh+Hl/128;
i++;
}
}
end2:
stoptime=twogap[1];
if(stoptime>72)//>20ms
stoptime=stoptime-36;
else stoptime=36;//10ms
if((startL>=30)&&(count<20)&&(stoptime>38)&&(stoptime<54)&&(width>=450))//JVC width<500
sharp_jvc=1;//stoptime of panda =47+36;
else
{
sum=startH+startL;
i=(sum+startH/2)/startH;
sum=sum/i;
startL=sum*((startL+sum/2)/sum);
startH=sum*((startH+sum/2)/sum);
}
width=minT/2;//minT/2
i=(minT+minL/2)/minL;
if(i>=3)
width=minT/4;
x=(minT-minL)*2;//minH*2
w=minL;
minL=(minL+FRR/2)/FRR;
if((minT>860)&&(minT<910))
if(((maxH>x)&&((maxH-x)<="x)&&((x-maxH)
{
width=minT/5;//touyingyi1.5:13:1
startL=5;
startH=4;
minL=12;
}
if((startL==0)&&(width<250)&&(i>=3))
sharp_jvc=2;
write(0+device*PAGESIZE,width/256);
write(1+device*PAGESIZE,width%256);
write(2+device*PAGESIZE,startH);
write(3+device*PAGESIZE,startL);
write(4+device*PAGESIZE,1);//gap =1
write(5+device*PAGESIZE,minL);
write(6+device*PAGESIZE,stoptime);
write(7+device*PAGESIZE,sharp_jvc);
end3:EX0=0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -