Ŀ
 The XF file format.                            version one coma zero three 
 by Kordian Klecha aka Jason of Exodus.                            o2.o2.98 


  The XF format was done...  and there should be long list of slogans,
  which are usually in use in cases like that.  No way.  This format
  was done only for my comfort.
  What can you choose when you want to put some texts in your production?
  You can use extremally ugly rom font,  two-color FNT format or just
  picture with offset table.  Well,  i think there are two or three hundreds
  other methods,  but i don't know them ;).  Call me lamer :).

Ŀ
 The XF file structure (for 16x16x4)                                        

   ͻ
     offset    lenght    comment                                      
   ͹
      0000      0003     ID:'XF!'                                     
   Ķ
      0003      0001     version,  should be 10h                      
   Ķ
      0004      0012     palette of 4 colours (rgb,0-63)              
   Ķ
      0016      1984     31 characters,  64 bytes per one             
   ͼ
     total:     2000   
   ͼ

  The first color in the table is the background color,  second,  third and
  fourth are colors,  which can be use in font.
  The palette is 'ready to use' :),  every color consist from three bytes:
  red,  green and blue,  value of everyone can be from 0 to 63.  You don't
  have to do anything,  but send the values to the vga port.

  The characters are written in quite easy method:
  Every character consists 16x16=256 pixels.  One byte informs about _four_
  pixels.  It is possible because we use four colours,  so two bits are
  enough for one pixel.

  Ŀ Ŀ Ŀ Ŀ
     
   0 1   1 1   0 0   0 1

Ŀ
 Unpacking                                                                  

  If you are beginner or for some reasons you can't 'unpack' it,  you can
  use my own procedure (written in 32-bits eos):

   Unpack_Font PROC
      mov   esi,o packed_font
      add   esi,16
      mov   edi,o unpacked_font
      mov   ecx,1984
   @@unpack_font:
      xor   edx,edx
      xor   eax,eax
      lodsb
      shl   ax,2
      mov   dh,ah
      xor   ah,ah
      shl   ax,2
      mov   dl,ah
      shl   edx,16
      xor   ah,ah
      shl   ax,2
      mov   dh,ah
      xor   ah,ah
      shl   ax,2
      mov   dl,ah
      mov   eax,edx
      stosd
      loop  @@unpack_font
      ret
   Unpack_Font ENDP

Ŀ
 Outro                                                                      

  Ok,  it's everything. For any questions, problems or ganjia meditations :)
  send me a letter.  Answer guaranteed,  but remember:  no swapping!