03-10-2012, 11:13 PM
nitrofurano Wrote:The code is really fast, but i didn't find the custom space therespacing variables:
On my code, i used a special area just for that (and i'm also thinking about using kernings there as well...)
And on my example i used 12 pixel lines instead of 8
xgap: gap between letters in pixels.
spacesize: gap of space
The width of all letters is automaticaly recognised, so it is not possible to define larger gaps for some letters (as this is nonsense), and it works also with narrow fonts like 4x8.
But back to your code:
To speed it up, replace multiplications and divisions with bitshifting.
Replacing
Code:
x1=int(x/8)
Code:
x1=x>>3
Edit:
Forget what I wrote. I'm stupid...
The biggest downslowing was
Code:
2^x2
Code:
dim i,j,adr,v,vq,vq2,c,xps,x1,x2,x3,x,y,c1 as uinteger
border 6:paper 7:ink 1: bright 1:cls
x=3:y=109
for c1=0 to 52
x1=x>>3
x2=7-(x mod 8)
x3=1<<x2
if x3=0 then x3=1:end if
for j=0 to 11
i= ((y+j)<<5)+x1
adr=(16384+((i band 31) bor ((i band 224)<<3) bor ((i band 1793)>>3) bor (i band 6144)))
v=peek(uinteger, adr)
vq2=(peek(@naftaregularcharmap+(12*c1)+j))*x3
vqbs= ((vq2 band 65280)>>8) bor ((vq2 band 255)<<8)
poke uinteger adr,v bor vqbs
next j
x=x+peek(@naftaregularcharmapspacing+c1)
next c1
pause 0
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!