Hello everyone! I've been working on this for a little while now(a week maybe?) and wanted to share this with the DBPro community that has helped me so much.
Basically, this is a set of 3 source files that contain approximately 37 functions to write text and numbers directly to an image through memblocks. The main function to call is "mem_writeString()" which needs the string, the image to write to, the position in the image (x and y coordinates), and the color you want the text to be.
Speed compared to other methods
DBP text to bitmap, get image(): 8306ms for 1000 iterations
D3DFunc text to bitmap,get image(): 8352ms for 1000 iterations
Memblock text: 747ms for 1000 iterations
*all speed results are an average of 3 different tests
Test code:
//Writing directly to memblocks
sync on
set display mode 1024,768,32,0
sync rate 0
backdrop on
autocam off
//Can be any image
//Recommended dimensions for this test(300x300)
load image dir exe()+"\media\progressBar.png",2,1
color backdrop rgb(150,150,150)
time=hitimer()
for x=0 to 1000
mem_writeString("abcdefg0123",2,1,1,1,rgb(255,255,255))
paste image 2,100,100
sync
next x
ntime=hitimer()
difftime=ntime-time
set cursor 10,10
print difftime
sync
wait 2000
create bitmap 1,300,300
time=hitimer()
for x=0 to 1000
set current bitmap 1
text 1,1,"abcdefg0123"
get image 3,0,0,300,300,1
set current bitmap 0
paste image 3,100,100
sync
next x
ntime=hitimer()
difftime=ntime-time
set cursor 10,30
print difftime
sync
wait 2000
delete bitmap 1
create bitmap 1,300,300
D3D_Init
D3D_Font 1,"Verdana",12,0,0,1
time=hitimer()
for x=0 to 1000
set current bitmap 1
D3D_StartText
D3D_Text 1,1,1,0,"abcdefg0123",rgb(255,255,255)
D3D_EndText
get image 3,0,0,300,300,1
set current bitmap 0
paste image 3,100,100
sync
next x
ntime=hitimer()
difftime=ntime-time
set cursor 10,50
print difftime
sync
wait 2000
end
The source files
Mem_WriteAlpha.dba
function mem_writeA(ul_x as integer, ul_y as integer,m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x+4,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+2,w),c
wid=5
endfunction wid
function mem_writeB(ul_x as integer, ul_y as integer,m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+10,w),c
wid=5
endfunction wid
function mem_writeC(ul_x as integer, ul_y as integer,m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
wid=4
endfunction wid
function mem_writeD(ul_x as integer, ul_y as integer, m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x+4,ul_y,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+10,w),c
wid=5
endfunction wid
function mem_writeE(ul_x as integer, ul_y as integer, m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x+1,ul_y,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+3,w),c
wid=5
endfunction wid
function mem_writeF(ul_x as integer, ul_y as integer,m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x+1,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
wid=4
endfunction wid
function mem_writeG(ul_x as integer, ul_y as integer,m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x+1,ul_y,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+11,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+11,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+11,w),c
write memblock dword m,getMemPos(ul_x,ul_y+10,w),c
wid=5
endfunction wid
function mem_writeH(ul_x as integer, ul_y as integer, m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+10,w),c
wid=5
endfunction wid
function mem_writeI(ul_x as integer, ul_y as integer, m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x,ul_y+6,w),c
wid=1
endfunction wid
function mem_writeJ(ul_x as integer, ul_y as integer, m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+11,w),c
write memblock dword m,getMemPos(ul_x,ul_y+10,w),c
//write memblock dword m,getMemPos(ul_x+1,ul_y+11,w),c
//write memblock dword m,getMemPos(ul_x,ul_y+10,w),c
wid=3
endfunction wid
function mem_writeK(ul_x as integer, ul_y as integer, m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+10,w),c
wid=5
endfunction wid
function mem_writeL(ul_x as integer, ul_y as integer,m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x,ul_y+10,w),c
wid=1
endfunction wid
function mem_writeM(ul_x as integer, ul_y as integer, m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+1,w),c
write memblock dword m,getMemPOs(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y,w),c
write memblock dword m,getMemPos(ul_x+6,ul_y,w),c
write memblock dword m,getMemPos(ul_x+7,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+7,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+7,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+7,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+7,ul_y+5,w),c
wid=8
endfunction wid
function mem_writeN(ul_x as integer, ul_y as integer, m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+1,w),c
write memblock dword m,getMemPOs(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+5,w),c
wid=5
endfunction wid
function mem_writeO(ul_x as integer, ul_y as integer, m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x+1,ul_y,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+4,w),c
wid=6
endfunction wid
function mem_writeP(ul_x as integer, ul_y as integer, m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+5,w),c
wid=6
endfunction wid
function mem_writeQ(ul_x as integer, ul_y as integer, m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+10,w),c
wid=6
endfunction wid
function mem_writeR(ul_x as integer, ul_y as integer, m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y,w),c
wid=5
endfunction wid
function mem_writeS(ul_x as integer, ul_y as integer, m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x+1,ul_y,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
wid=5
endfunction wid
function mem_writeT(ul_x as integer, ul_y as integer,m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
h=memblock dword(m,4)
d=memblock dword(m,8)
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+6,w),c
wid=5
endfunction wid
function mem_writeU(ul_x as integer, ul_y as integer, m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+4,w),c
wid=5
endfunction wid
function mem_writeV(ul_x as integer, ul_y as integer, m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+6,ul_y,w),c
wid=7
endfunction wid
function mem_writeW(ul_x as integer, ul_y as integer, m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+6,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+7,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+7,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+7,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+8,ul_y,w),c
write memblock dword m,getMemPos(ul_x+8,ul_y+1,w),c
wid=9
endfunction wid
function mem_writeX(ul_x as integer, ul_y as integer,m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y,w),c
wid=6
endfunction wid
function mem_writeY(ul_x as integer, ul_y as integer, m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+10,w),c
wid=6
endfunction wid
function mem_writeZ(ul_x as integer, ul_y as integer,m as integer, c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+5,w),c
wid=5
endfunction wid
Mem_WriteNum.dba
function mem_write0(ul_x as integer, ul_y as integer, m as integer,c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+8,w),c
wid=6
endfunction wid
function mem_write1(ul_x as integer, ul_y as integer, m as integer,c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+10,w),c
wid=5
endfunction wid
function mem_write2(ul_x as integer, ul_y as integer, m as integer,c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x+1,ul_y,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+10,w),c
wid=6
endfunction wid
function mem_write3(ul_x as integer, ul_y as integer, m as integer,c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+10,w),c
wid=6
endfunction wid
function mem_write4(ul_x as integer, ul_y as integer, m as integer,c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+5,w),c
wid=6
endfunction wid
function mem_write5(ul_x as integer, ul_y as integer, m as integer,c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+10,w),c
wid=5
endfunction wid
function mem_write6(ul_x as integer, ul_y as integer,m as integer,c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x+4,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+5,w),c
wid=6
endfunction wid
function mem_write7(ul_x as integer, ul_y as integer, m as integer,c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+10,w),c
wid=6
endfunction wid
function mem_write8(ul_x as integer, ul_y as integer, m as integer,c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x+1,ul_y,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+10,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+10,w),c
wid=6
endfunction wid
function mem_write9(ul_x as integer, ul_y as integer, m as integer,c as dword)
w=memblock dword(m,0) : local wid as integer
write memblock dword m,getMemPos(ul_x+1,ul_y,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y,w),c
write memblock dword m,getMemPos(ul_x,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+1,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+2,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+3,w),c
write memblock dword m,getMemPos(ul_x+5,ul_y+4,w),c
write memblock dword m,getMemPos(ul_x+1,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+5,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+6,w),c
write memblock dword m,getMemPos(ul_x+4,ul_y+7,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+8,w),c
write memblock dword m,getMemPos(ul_x+3,ul_y+9,w),c
write memblock dword m,getMemPos(ul_x+2,ul_y+10,w),c
wid=6
endfunction wid
Mem_WriteString(includes two utility functions I use)
function mem_writeString(s as string, i as integer, m as integer, x as integer, y as integer,c as dword)
local o : o=0
//some fancy dynamic arrays...
dim CString(fast len(s)) as string
//and passing array pointers around
local arr_ptr as integer : arr_ptr=get arrayptr(CString())
unlink array CString()
//Getting the individual letters
arr_ptr=DBPString_to_CStyle(s,arr_ptr)
//Using the actual data
link array CString(),arr_ptr
local ascii : ascii=0
make memblock from image m,i
//Call the draw functions...along with all the logic
for x=1 to get array count(CString(),1)
ascii=asc(CString(x))
if ascii=32
o=o+4
else
if ascii>=48 and ascii<=57
o=o+(_WRITE_NUM(ascii,x+o,y,m,c))
else
if ascii>=97 and ascii<=122
o=o+(_WRITE_ALPHA(ascii,x+o,y,m,c))
endif
endif
endif
next x
make image from memblock i,m
unlink array CString()
endfunction
function _WRITE_NUM(a as integer, x as integer, y as integer, m as integer, c as dword)
local offset_inc : offset_inc=0
select a
case 48:
offset_inc=mem_write0(x,y,m,c)
endcase
case 49:
offset_inc=mem_write1(x,y,m,c)
endcase
case 50:
offset_inc=mem_write2(x,y,m,c)
endcase
case 51:
offset_inc=mem_write3(x,y,m,c)
endcase
case 52:
offset_inc=mem_write4(x,y,m,c)
endcase
case 53:
offset_inc=mem_write5(x,y,m,c)
endcase
case 54:
offset_inc=mem_write6(x,y,m,c)
endcase
case 55:
offset_inc=mem_write7(x,y,m,c)
endcase
case 56:
offset_inc=mem_write8(x,y,m,c)
endcase
case 57:
offset_inc=mem_write9(x,y,m,c)
endcase
endselect
endfunction offset_inc
function _WRITE_ALPHA(a as integer, x as integer, y as integer, m as integer, c as dword)
local offset_inc : offset_inc=0
select a
case 97:
offset_inc=mem_writeA(x,y+5,m,c)
endcase
case 98:
offset_inc=mem_writeB(x,y,m,c)
endcase
case 99:
offset_inc=mem_writeC(x,y+5,m,c)
endcase
case 100:
offset_inc=mem_writeD(x,y,m,c)
endcase
case 101:
offset_inc=mem_writeE(x,y+5,m,c)
endcase
case 102:
offset_inc=mem_writeF(x,y,m,c)
endcase
case 103:
offset_inc=mem_writeG(x,y+5,m,c)
endcase
case 104:
offset_inc=mem_writeH(x,y,m,c)
endcase
case 107:
offset_inc=mem_writeK(x,y,m,c)
endcase
case 108:
offset_inc=mem_writeL(x,y,m,c)
endcase
case 109:
offset_inc=mem_writeM(x,y+5,m,c)
endcase
case 110:
offset_inc=mem_writeN(x,y+5,m,c)
endcase
case 111:
offset_inc=mem_writeO(x,y+5,m,c)
endcase
case 112:
offset_inc=mem_writeP(x,y+5,m,c)
endcase
case 113:
offset_inc=mem_writeQ(x,y+5,m,c)
endcase
case 114:
offset_inc=mem_writeR(x,y+5,m,c)
endcase
case 115:
offset_inc=mem_writeS(x,y+5,m,c)
endcase
case 117:
offset_inc=mem_writeU(x,y+5,m,c)
endcase
case 118:
offset_inc=mem_writeV(x,y+5,m,c)
endcase
case 119:
offset_inc=mem_writeW(x,y+5,m,c)
endcase
case 120:
offset_inc=mem_writeX(x,y+5,m,c)
endcase
case 121:
offset_inc=mem_writeY(x,y+5,m,c)
endcase
case 122:
offset_inc=mem_writeZ(x,y+5,m,c)
endcase
endselect
//i,j
if (a=105) or (a=106)
if a=105 then offset_inc=mem_writeI(x,y+4,m,c)
if a=106 then offset_inc=mem_writeJ(x,y+4,m,c)
endif
offset_inc=offset_inc+1
endfunction offset_inc
function getMemPos(x as integer, y as integer, width as integer)
local pos as integer
pos=(((y*width)+x)*4)+12
endfunction pos
function DBPString_to_CStyle(t as string,ptr as integer)
local aLen as integer : aLen=get arrayptr count(ptr)
local sLen as integer : sLen=fast len(t)
dim tmp(aLen) as string
link array tmp(),ptr
for i=0 to sLen
tmp(i)=mid$(t,i)
next i
ptr=get arrayptr(tmp())
unlink array tmp()
endfunction ptr
Enjoy! If you want to add your own features/use in a commercial project/use in a free project go ahead! However, if you turn this into a plugin I'd like to be notified at my listed email address.