DSCF

.co.uk

PC32

A ColorForth compiler and editor for x86-64
git clone https://dscf.co.uk/clone/PC32.git
Log | Files | Refs | README

images.l (505B)


      1 #!/usr/bin/pil
      2 
      3 (de w16 (X)
      4 	(wr (& X 255))
      5 	(wr (& (>> 8 X) 255)) )
      6 
      7 
      8 (de runimg(path)
      9 	(let (sze	(in path (rd -18) (list (rd -4) (rd -4)))
     10 			offa	(in path (rd -10) (rd -4))
     11 			ctbl	(make (in path (rd -54) (for N (* 16 4) (link (rd 1)))))
     12 			bytes	(make (in path (rd offa)
     13 						(for N (apply * sze) (link (rd 1))) ) )
     14 			)
     15 		(out "../../data/tex.bin" 
     16 			(w16 (car sze)) 
     17 			(w16 (cadr sze))
     18 			(for N ctbl (wr N))
     19 			(for N bytes (wr N)) )
     20 ) )
     21 
     22 #(runimg "IMG/tile.bmp")
     23 (runimg "IMG/test.bmp")
     24 (bye)
     25