// JUMP BONUS function pi(){ uart("PC IMAGE 05\n"); uart("PC LINE 00 2C 4F 2C 0A\n"); uart("PC LINE 00 2B 4F 2B 0A\n" lc(5,9); log("BONUS STAGE"); ); } var gb=0x1,x=7,y=6,v=0,jf=0,k=1,db=0,sb=0,sz=0,s; if(env()>0){ s=env(); }else{ s=0; } function er(ex,ey){ uart(0x80,0x0e,0x03,ex,ey,10,255,255,255,255,255,255,255,255); } function ch(cx,cy,it){ uart(0x80,0x06,0x14,cx,cy,it); } function dr(gb){ var j=0,i,g0; while(j<16){ g0=gb>>j&1; uart(0x80,0x08,0x01,80-j*5,42,75-j*5,42,g0*10); j=j+1; } } function it(qb,it,iy){ var j=0; while(j<16){ if(qb>>j&1>0){ uart(0x80,0x06,0x14,69-j*5,iy,it); if((j>0)*(qb>>(j-1)&1<1){ uart(0x80,0x0e,0x03,77-j*5,iy,10,248,248,248,248,248,248,248,248); } } j=j+1; } er(0,iy); } function jp(){ var ik; ik=inkey(); if((ik==32)*(jf<1)){ jf=1;v=-3; uart(0x80,0x0b,0x09,0,14,0,5,5,255,5,255); } er(x*5-1,y*4+10); er(x*5-1,y*4+7); x=x+(ik==29)*(x<14)-(ik==28)*(x>0); y=y+v; if(jf>0){ v=v+1; } ch(x*5-1,y*4+9+s%2,0x0e); ch(x*5-1,y*4+7+s%2,3); if(y>5){ jf=0; v=0; } if((db>>(15-x)&1>0)*(y==3)){ db=db&~(1<<15-x); s=s+100; uart(0x80,0x0b,0x09,7,7,5,5,5,255,5,255); } if((sb>>(15-x)&1>0)*(y==3)){ sz=1; sb=sb&~(1<<15-x); k=0; video(0); } if((gb>>(15-x)&1>0)*(y>5)){ er(x*5-1,27); ch(x*5-1,39,1); video(1); uart(0x80,0x0b,0x09,4,9,5,1,4,255,4,255); sleep(500); uart(0x80,0x0b,0x09,4,255,5,255,5,255,4,255); env(s); lrun(58); } } function main(){ var d; while(1){ if(k>0){ k=k+1; gb=~(0xffff>>k/5)|gb; } if(gb>>13==7){ d=0; }else{ d=(rnd(20)<1); } gb=(gb<<1)+d&0xffff; db=(db<<1)+(rnd(5)<1)&0xffff; sb=(sb<<1)+(rnd(20)<1)&0xffff; s=s+1; if(sz>0){ sz=sz+1; } if(sz>31){ sz=0; k=1; video(1); } dr(gb); jp(); it(db,0x35,22); it(sb,0x1e,22); lc(5,10); log("SCORE ",s,"\n"); uart(0x80,0x0b,0x09,5,255,5,255,5,255,5,255); } } cls(); pi(); main();