#!/usr/local/bin/yab246 WS=320 : HS=320 tsprites=2:MaxSprites=2 dim SpriteName$(tsprites) dim Fast$(MaxSprites,350) dim DirtyX(65000), DirtyY(65000) if peek("argument")=1 then FileName$=peek$("argument") else print "Usage: xbm2ybm.yab xbitmap-File" end fi gosub Initialize clear screen sprite=1 SpriteName$(sprite)=FileName$ gosub LoadSprite print SpriteName$(sprite) print "Xbm loaded" WS=2*ancho:HS=2*alto open window WS+5,HS+5 print time$," - "; deltax=0:deltay=0: gosub ShowXbm print time$ print ancho,alto,colbytes rem k$=inkey$ offsetx=ancho offsety=alto print "Fast" print time$," - "; point=0 for linea=1 to alto for colu=1 to ancho tem$=mid$(Fast$(sprite,linea),colu,1) if tem$="1" then dot colu+offsetx,linea+offsety point=point+1 DirtyX(point)=colu DirtyY(point)=linea fi next colu next linea print time$ rem k$=inkey$ print "Dirty" print time$," - "; for cont=1 to point dot DirtyX(cont),DirtyY(cont)+alto next cont print time$ gosub SaveYbm label keyloop k$=inkey$ if k$="q" then close window : end fi goto keyloop end LABEL Initialize dim Sprites$(MaxSprites,320,80) newline$=chr$(10) halpha$="123456789abcdef" dim nibles$(16) for i=1 to 16 read nibles$(i) next i data "0000","0001","0010","0011" data "0100","0101","0110","0111" data "1000","1001","1010","1011" data "1100","1101","1110","1111" BitmapPATH$="./" return :rem Initialize label SaveYbm outfile$=left$(FileName$,len(FileName$)-4) outfile$=outfile$+".ybm" print "wait , saving ",outfile$ open 1,outfile$,"w" print #1 "rem Picture" print #1 "data ",str$(ancho,"%3.0f"), " , " ,str$(alto,"%3.0f") for i=1 to alto print #1 "data ", "\"", Fast$(sprite,i), "\"" next i close 1 print "ok" return rem