Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/sdlbrt
- finp$="retrorio02.svg" '- svg file in 320x250 pixels size
- shell(" convert "+finp$+" "+finp$+".bmp" )
- setdisplay(640,250,32,1):paper(8^8-1):ink(0):pen(0):cls
- loadimage(finp$+".bmp",1):pasteicon(0,0,1):pasteicon(320,0,1)
- shell("rm "+finp$+".bmp" )
- dim sttgl$[200],dtal$[200]
- for y=0 to 249:for x=0 to 319
- ink(0xFFFFFF)
- if (point(320+x,y)mod 256)<128 then:ink(0x000000):end if
- dot(320+x,y)
- next:next
- for ct=0 to 191
- sttgl$[ct]="seteg("+str$(255)+"),\"00000000000000000000\""
- next
- open finp$+"_.txt" for output as #1
- setcaption("?")
- ct=0
- for y1=0 to 24
- a$=str$(1210+(y1*2))+" data "
- b$=str$(1211+(y1*2))+" data "
- for x1=0 to 39
- q=0
- for y2=0 to 9:for x2=0 to 7
- if (point(x1*8+x2,y1*10+y2)mod 256)<192 then:q=1:end if
- next:next
- if q<>0 then:
- ink(0xFF0000)
- if ct>=192 then:ink(0xFFFF00):end if
- if ct<192 then
- if x1<20 then:
- a$=a$+"&\""+right$("00"+hex$(ct),2)+"\",":end if
- if x1>=20 then:
- b$=b$+"&\""+right$("00"+hex$(ct),2)+"\",":end if
- end if
- setetgo$=""
- for y2=0 to 9
- btv=0
- for x2=0 to 7
- if (point(320+x1*8+x2,y1*10+y2)mod 256)<128 then:btv+=2^(7-x2):end if
- next
- setetgo$+=right$("00"+hex$(btv),2)
- next
- if ct<96 then:
- sttgl$[ct]="setet("+str$(160+ct)+"),\""+setetgo$+"\""
- end if
- if ct>=96 then:
- sttgl$[ct]="seteg("+str$(160+ct-96)+"),\""+setetgo$+"\""
- end if
- bar(x1*8,y1*10,x1*8+7,y1*10+9):ct+=1:setcaption(str$(ct))
- end if
- if q=0 then
- if x1<20 then:
- a$=a$+"&\""+right$("00"+hex$(255),2)+"\",":end if
- if x1>=20 then:
- b$=b$+"&\""+right$("00"+hex$(255),2)+"\",":end if
- end if
- next
- dtal$[y1*2]=a$
- dtal$[y1*2+1]=b$
- next
- print #1,"1000 init 7,0"
- for y1=0 to 191
- 'txou$=str$(1050+int(y1/4))+" "+sttgl$[y1]+":"+sttgl$[y1+1]+":"+sttgl$[y1+2]+":"+sttgl$[y1+3]
- txou$=str$(1001+y1)+" "+sttgl$[y1]
- print #1,txou$:next
- print #1,"1200 restore 1210"
- print #1,"1201 for i=0 to 999"
- print #1,"1202 read a"
- print #1,"1203 if a<96 then poke 16384+(i*2),160+a:poke 16385+(i*2),64+7"
- print #1,"1204 if a>=96 and a<192 then poke 16384+(i*2),160+a-96:poke 16385+(i*2),240"
- print #1,"1205 if a>=192 then poke 16384+(i*2),32:poke 16385+(i*2),64+7"
- print #1,"1206 display"
- print #1,"1207 next i"
- for y1=0 to 49
- print #1,dtal$[y1]:next
- setcaption(str$(ct))
- close #1
- 'grab(1,0,0,320,240):saveimage("pic1b.bmp",1)
- waitkey
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement